Search code examples
dllrebolrebol3

How to do load/library


In the past, using REBOL/Command, this worked fine. Now, I'm trying to load/library a .dll that I compiled and there is no /library refinement for load any longer. What is the equivalent in Rebol 3? Do I have to make an 'extension and import it?


Solution

  • Yes, Rebol 3 does not currently contain a Rebol 2-like DLL interface, which was limited and did not offer many useful options to wrap libraries, and e.g. callbacks were very limited too. Rebol 3 solved the situation by introducing an extension mechanism, which involves a little bit of a C code.

    There was also some initiative to bring in improved Rebol 2-like DLL interface in form of a Rebol 3 extension, but the project did not work out yet, although after the ReCode conference, someone was claiming, it will come.

    What you could also use is Red/System: it is a Rebol-like language, but very close to C level, so rather easy to wrap things around. Kaj De Vos created some examples, which show how to write an Rebol 3 extension as Red/System DLL.