[gambit-list] Embedding Gambit as a dll.

Neil Baylis neil.baylis at gmail.com
Wed Oct 22 18:16:36 EDT 2008


Hello,

I'm working on a project to make an iTunes plugin. I want to use Scheme as
an embedded extension language for it.

I've managed to get this working using Tiny Scheme, but now would like to
try to get a better (i.e. faster) Scheme implementation in there. Hopefully,
I can get compiled Scheme in there, instead of interpreted.

Is it possible to do this with Gambit? The crux of the problem is that the
scheme code cannot declare main(). Instead, it needs to provide an init
function and a deinit function. My plugin would call the init function when
it loads, and the deinit function when it unloads. There is no stdin or
stdout. When the plugin is operating, iTunes will repeatedly call a single
function, lets call it the work function.

(Actually, there is a stdout.. because if I call printf, the output ends up
in the system log file. But I can't reassign it, and there's no stdin).

So, the init function will need to set up the scheme environment. Then, when
the work function is called, it will need to reference the scheme
environment, and call a scheme function in that environment to do the work.

I need to provide this functionality as a library that is dynamically loaded
by iTunes. As I mentioned above, iTunes already declares main().

If someone could point me at some sample code that embeds Gambit in this
manner, or otherwise point me in the right direction, it would be a great
help.

Thanks,

Neil Baylis.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20081022/6c5afe42/attachment.htm>


More information about the Gambit-list mailing list