Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If a language can’t use shared objects at all, it’s really not much use, is it? Almost all languages make use of at least the posix syscall interfaces provided by the OS, and some platforms don’t even allow you to roll your own syscalls, iirc.

In my eyes it’s more important that FFI be easy, automatic, and as efficient as possible. Go imposes a significant cost on FFI, for example, and many languages have typesystems that are very unfriendly to C ABI or basically require swig.

One thing I really appreciate about Lua is that I can write Lua interfaces for my classes and methods quite easily, and even use Lua as a garbage-collected allocator for native types. Automating the generation of Lua interfaces can easily be done natively with metaprogramming, without involving dependencies like swig. It’s so good that instead of feeling like you’re figuring it out on the Lua side, it’s as if Lua puts the host language first, Lua doesn’t even need to be the owner of the process. It is almost ideal other than the clumsy interface between the stack-like C side and tables, and the dynamic parameter lists.

For so many languages FFI is an afterthought at best.



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

Search: