Hacker News new | past | comments | ask | show | jobs | submit login

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



LuaJIT has http://luajit.org/ext_ffi.html and Python has 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.




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

Search: