Le 17 février 2012 13:36, Myrosia Dzikovska <email@example.com> a écrit :
Sbcl manual says that calling LISP from C is hackish and poorly
supported, and does not provide any detail. In practice, doing this in
ACL is extremely hackish as well, with various issues and
restrictions. But it was documented enough for me to make it work.
Has anyone had any experience with calling lisp from C in sbcl? I'd
like to know if this is worth my time, or I should look for a
different LISP distribution
The manual is pretty out-of-date on that point: it hasn't been updated since alien callbacks were merged 6 years ago or so. You could either use CFFI's facility, or SBCL's, which isn't fully exported and documented: sb-alien::define-alien-callback. In either case, you need to let Lisp start the process, and you should only call from C into Lisp in threads created from Lisp. That last point was already mentioned, but isn't strictly true; you can set things up to call into Lisp from a thread created by C, but it probably isn't work the effort (and that *is* hackish).
All in all, C-to-Lisp support is about equally workable but unpleasant in both ACL and SBCL.