Writing Externals in Pascal?
Peter W A Wood
peterwawood at gmail.com
Thu Jul 8 05:16:22 EDT 2010
I suspect that writing a dynamic link library for use with Rebol is likely to be easier than writing an external for Revolution. The Rebol language is evaluated not compiled.
I found writing a dynamic link library with FPC quite straightforward though I encountered two problems which I have been able to overcome.
The first could hinder developing complicated externals for Revolution. FPC does not support error handling in dynamic link libraries, so no try/finally etc.. I believe this is due to the difficulty of coming up with a cross-platform implementation. This limitation can probably be overcome through conservative and defensive coding in most cases. In my case, I perform additional validations in the Rebol module that calls the dynamic link library.
The second is that there is a conflict between the Mac OS X Snow Leopard linker and FPC. There is a work around but the resulting dynamic link library is not fully stable. I believe this is something to do with initialisation and termination routines. The workaround is to compile the dynamic link library under Mac OS X Leopard.
The dynamic link library is very simple but runs successfully on Windows, Ubuntu and Mac OS X.
On 8 Jul 2010, at 00:26, Mark Wieder wrote:
> Monday, July 5, 2010, 4:59:11 PM, you wrote:
>> Free Pascal. At the moment, I am testing calling a dynamic load
>> library written in Free Pascal from Rebol (a language written in C)
>> using C calling conventions.
> Keep us posted on your progress - that's a promising start.
> -Mark Wieder
> mwieder at ahsoftware.net
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode