On 21 Nov 2014, at 18:48, [email protected] wrote:
> 
> Hello,
> 
> I need some help getting started with ffi. 
> 
> I am attempting to bind libuv to scheme code.

Hello.

You can not just call lambda from foreign code because garbage collector moves 
those around and the program will eventually crash. You need to declare it as 
an external function like Richard suggested so it essentially becomes C 
function.

Incidentally, I’m experimenting with adding libuv to CHICKEN too. The idea is 
to just suspend the thread waiting for a callback and let the scheduler to 
figure out which lambda to call later. You can look at my early draft on:

https://github.com/bazurbat/chicken-scheme/blob/next/src/scheduler/scheduler-uv.scm

and accompanying scheduler.c which might give you ideas about FFI.

-- 
Regards, Oleg
Art System


_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to