posted by Kaj-de-Vos on Fri 26th Nov 2010 14:52 UTC
IconThe new version 3 of the REBOL programming language supports extensions written in other languages. Extensions are implemented on top of the modules framework, which is also new. Extensions can be separate dynamically loaded libraries, or they can be embedded in the REBOL executable. In fact, REBOL 3 is now highly modularised: a number of its subsystems are embedded modules, and subsystems written in C and C++ are embedded extensions. Those modules and extensions are part of the open host kit, so that custom collections can be compiled into REBOL executables.

Syllable is now running its first REBOL extension (screenshot on Syllable Desktop). It's an example extension in the style of the traditional Hello World that shows the ease of interfacing. It works without changes on both Syllable Desktop and Syllable Server. The source code is in Syllable's build system. It should work on all Linux systems and the makefile also has hints for Windows (using the MinGW GNU environment). It should be easy to adapt to the other platforms that the REBOL host kit supports. To compile and load the extension on Syllable Desktop, do the following. See the previous article for the requirements.

build update
build log
build get HelloREBOL-Extension--current
build patch HelloREBOL-Extension--current
build HelloREBOL-Extension--current
cd HelloREBOL-Extension--current
r3
import %./hello-extension.so
hello-once
hello-twice

To compile on Syllable Server:

s build update
build log
build HelloREBOL-Extension--current
cd HelloREBOL-Extension--current
r3
import %./hello-extension.so
hello-once
hello-twice

e p (2)    9 Comment(s)

Technology White Papers

See More