by cnbland · 5y ago · 0 comments
However, a C interface is required. Is this one the recommended solution? Is it really portable?
https://common-lisp.net/project/cffi/
What is the speed compared to a Python C extension? Are implementation-specific C interfaces faster (I guess they are)?
Sorry for so many questions, but these can usually only be answered by people who have actually used the interface.
Re: CFFI vs. built-in API
The main difference is what features you have. For example, if you need errno, you will need to do something implementation specific (I'm currently working on a wrapper for that functionality though).
Another example: ECL let's you inline C code in the middle of a lisp program. Most other implementations don't.
As far as performance goes, the actual overhead of calling C is minimal, but if you need to copy large amounts of data, that can kill performance.
There is another library called static-vectors that let's you allocate buffers that can be used natively in both lisp and C, on the implementations that allow doing so.
Is python the language that has spread furthest from programming circles? It probably used to be VB mostly due to Office, but with Python at #2 in Tiobe ahead of Java and behind only C, I'd guess yes.