Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Actually I was talking about how to bundle C code with a Common Lisp library (or system), so that ASDF could also handle building it.

Guile has a C API in libguile, so you can create C that's directly callable from Scheme with little overhead. You can write Scheme procedures in C and you don't need to gobthrough FFI.

As far as I know both languages have FFI. CL has CFFI, Guile has it in its standard library.

But can I actually ship some C code with my CL system and have ASDF take care of building it? If I want to ship CL bindings for a C library, as far as I've understood I need to tell users to install the library first. Maybe something like Clasp offers a C++ API?

Then again in both languages you can always use FFI and if things get hairy you can use grovelling.

With Guile, it's really easy to have a C library and package its guile bindings in the same place. Not saying you can't do this in CL, just that I don't know what it would look like to ship both C and CL in the same package.

(author)



Someone requested to add a project to Quicklisp; that project does just what you describe. See the ASD file for details.

https://github.com/tdrhq/cl-unix-sockets


a bit about the context:

Guile is an extended specific implementation of Scheme. Common Lisp OTOH is a language standard with widely different implementations. Just like Scheme has very different implementations - in sizes of small, medium and large.

Common Lisp with more extensive C extension support are CLISP (written in C, not that well supported nowadays), ECL ('embeddable Common Lisp', compiling to C), CLASP (integration with C++ via LLVM), mocl (commercial whole program compiler to C) and a bunch of others.

Thus the support of and integration into is different in Common Lisp implementations, just like it is different in Scheme implementations. GUILE was designed for C embedding, just like some Common Lisp implementations were designed for that task. Guile was also designated as a language of choice for the GNU project, which adds quite a bit community support - while Common Lisp (or one of its implementation) was not:

'Guile is the GNU Ubiquitous Intelligent Language for Extensions, and the official extension language of the GNU project.'




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: