chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Is chicken scheme suitable for this job?


From: felix winkelmann
Subject: Re: [Chicken-users] Is chicken scheme suitable for this job?
Date: Wed, 31 Oct 2007 07:33:09 +0100

On 10/30/07, naruto canada <address@hidden> wrote:
> hi
>
> (I'm sending seceral scheme implementors this message)
> Can chicken scheme fulfill this requirement?
> Let's say I have to implement some numerical library,
> and given some C headers files and description for what the library should do,
> and the C interface can not be changed for binary compatibility and ABI 
> reason.
> The library is simply numerical and
> no IO or system call allowed (except malloc, free, and fprintf for debug).
> Can Hobbit generate C code that is suitable for linking and embeding
> in other project? There is no need for an interpreter.

Yes, this is possible. You can use "define-external" to define entry-points
into the library and implement the code in Scheme. One important point
is required though: you have to initialize the Scheme code once, so there
should be some sort of initialization function that executes "CHICKEN_run()",
before the callbacks are in place. See

http://chicken.wiki.br/Embedding

for more information. As Kon already pointed out, linking together a minimal
set of runtime code can be a bit of work, but is in general not a problem
and is solvable (just ask here on this list).


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]