sbcl-librarian
cl-autowrap
sbcl-librarian | cl-autowrap | |
---|---|---|
6 | 9 | |
89 | 208 | |
- | - | |
2.9 | 2.8 | |
6 days ago | about 1 month ago | |
Common Lisp | Python | |
MIT License | BSD 2-clause "Simplified" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sbcl-librarian
-
Common Lisp language extensions wish list?
The other direction, using Lisp from C, is trickier, see sbcl-librarian
-
How to use cl-librarian?
Here's an example file of a wonderful library cl-librarian that claims to export lisp code into libraries of C and python. However, they do not provide explicit examples of how you can call the codes in python.
-
svetlyak40wt/sbcl-lib: Example of using Common Lisp code from C (using SBCL).
This is a nice little example. I know svetlyak knows this, but I'd appeal for people to use sbcl-librarian instead of doing it the manual way as the linked GitHub repository suggests, unless you have a very specific reason or you need to highly customize control.
-
LISP interop
See: https://github.com/quil-lang/sbcl-librarian and in SBCL manual: http://www.sbcl.org/manual/index.html#Lisp-as-a-Shared-Library
-
ELS Live Now
lighting talk: sbcl-librarian already used in production for scientific (quantum?) tools https://github.com/quil-lang/sbcl-librarian
-
Is there a way to generate a shared library (and ideally header) out of a CL file?
With SBCL, the answer is now yes. We are still working on improving it, and we haven't written a blog post about it yet, but check out SBCL-LIBRARIAN and specifically the little calculator example it ships with.
cl-autowrap
-
Pair Your Compilers at the ABI Café
Some Common Lisp FFIs have opted to coax this information out of the compiler. https://github.com/rpav/c2ffi is a C++ tool that links to libclang-cpp and literally outputs JSON with sizes and alignments. (It is then used by https://github.com/rpav/cl-autowrap to autogenerate a Lisp wrapper.) The older CFFI Groveller [1] works by generating C code which is compiled by the system C compiler (e.g. GCC or Clang) and, when executed, prints Lisp code that contains resolved values of constants, sizes, alignments, etc.
[1] https://cffi.common-lisp.dev/manual/html_node/The-Groveller....
-
Why Is Common Lisp Not the Most Popular Programming Language?
> Lack of access to the C libraries.
???
I recently started learning Common Lisp for fun (and fun it is!) and the ease of accessing C libraries was one of the things that surprised me in a positive way.
Using https://github.com/rpav/cl-autowrap one can simply write (c-include "file.h") and the API defined in "file.h" is accessible from Lisp. I can't think of a simpler way.
Even without cl-autowrap, FFI using https://cffi.common-lisp.dev/ seems simple enough.
-
An Idea for Piggybacking Python (language) ecosystem
I think the closest is cl-autowrap. I can imagine a higher level wrapper around it by which it can translate the python header file into the CL counterpart, although I'm not sure how much work the translation might entail. Also, because python and lisp semantics can differ considerably, the generated code might be trying to do weird things - again an issue of translation.
-
Why Functional Programming Should Be the Future of Software
Common lisp has a "pretty OK" story for calling C code whenever some speed is needed [0,1]. In my opinion, they suffer from some of the documentation/quick start problems that common lisp has, but they're otherwise usable.
Some of Naughty Dog's late 90's/early 2000's games (Jak and Daxter, Jak II) were written in a lisp called GOAL, Game Oriented Assembly Lisp [2]
[0] https://github.com/rpav/cl-autowrap
-
Common Lisp language extensions wish list?
The closest thing to what you request, that I'm aware of, is cl-autowrap (to use C code from Lisp) but it is not standard in any way. CFFI is the de facto standard for using C from Lisp across different implementations.
-
I have bolted together ECL and the Irrlicht game library
:claw tracks back to 2017 as a fork of cl-autowrap with cl-autowrap/pull/83 feature.
-
Common Lisp
If you're interested in FFI, then yeah CFFI is the standard. The other comments addressed speed, I also wanted to point out https://github.com/rpav/cl-autowrap which is built on top of CFFI and can help get a wrapper up and running faster. After using autowrap's c-include you can then use CFFI basically like normal or some useful autowrap/plus-c's helper functions -- e.g. in one project, I have an SDL_Event (https://wiki.libsdl.org/SDL_Event) and to access event.key.keysym.scancode I have a helper function that's just (plus-c:c-ref event sdl2-ffi:sdl-event :key :keysym :scancode). Last year I wanted to try out using FMOD, and even though it's closed source and has a (to me) "interesting" API things worked easily: https://gist.github.com/Jach/dc2ec7b9402d0ec5836a935384cacdc... More work would be needed to make a nice wrapper, type things more fully, etc. but depending on the C library you might find someone's already done that (or made a start) and made it available from quicklisp.
-
[Common Lisp] Best Libraries for Interfacing with UNIX-like Operating Systems?
In recent years there has also been cl-autowrap; caveats -
-
Alternative to ECL?
There is the cl-autowrap that can generate lisp packages from C header filesc- I am unsure if it sticks to ANSI C or goes beyond. It inturn depends on c2ffi for the first time around.
What are some alternatives?
sbcl-lib - Example of using Common Lisp code from C (using SBCL).
c2ffi - Clang-based FFI wrapper generator
cffi - The Common Foreign Function Interface
chibi-scheme - Official chibi-scheme repository
cl-rashell - Resilient replicant Shell Programming Library for Common Lisp
mal - mal - Make a Lisp
claw - Common Lisp autowrapping facility for C and C++ libraries
c-mera - Next-level syntax for C-like languages :)
racket - The Racket repository
FrameworkBenchmarks - Source for the TechEmpower Framework Benchmarks project
peds - Type safe persistent/immutable data structures for Go
CPython - The Python programming language