4 ms·
For instance, interfacing with c in factor works like this. You have an internal dsl that allows you to express what the signature of a c function is. It is des
by pathsjs 11y ago
For instance, interfacing with c in factor works like this. You have an internal dsl that allows you to express what the signature of a c function is. It is designed to look like a function declaration in c, but it is actually valid factor. And... that's it! You can now call that function, and some meta programming drives from that pseudo signature all the information to translate values back and forth
- sitkack 11y agoLuaJIT has http://luajit.org/ext_ffi.html http://luajit.org/ext_ffi.html and Python has https://cffi.readthedocs.org/en/latest/ https://cffi.readthedocs.org/en/latest/ modeled after LuaJIT. The API for Lua is very clean for being magic free, something that cannot be said for the CPython API.