4 ms·
> One of the problems that CPython has struggled with over the years is its C API for extensions. Honest question: is there an example of a language that does
by jkingsbery 6y ago
> One of the problems that CPython has struggled with over the years is its C API for extensions.
Honest question: is there an example of a language that does C extensions well? As a professional programmer, I have worked at different times with C extensions in Node.js, Java, R, and Erlang, (in addition to Python). Erlang and Node.js were maybe ok, but had their own challenges.
- flohofwoe 6y agoI found Lua <=> C interop very easy to use, I guess because Lua has been designed as an extension language for otherwise native projects (but it works just as well in the other direction, extending Lua projects with native code). The same is most likely true for other "scripting languages" where the main purpose is to add a scripting API to otherwise native applications (like Wren: https://github.com/wren-lang/wren https://github.com/wren-lang/wren)
- laurencerowe 6y agoLuaJIT's FFI inspired the PyPy team's CFFI (which also works with CPython.) https://cffi.readthedocs.io https://cffi.readthedocs.io
- pjmlp 6y agoTcl used to be a pleasure, then again I haven't touched it since 2002.
- microtherion 6y agoI was going to mention Tcl. I suspect that the richer the semantic model of the language, the more challenging it is to provide a straightforward C API.