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

Actually, I very much wanted to do that, the problem is that there seems to be no Scheme implementation available that offers such a tight and convenient libffi integration. LuaJIT parses preprocessed C header files with very few adjustments. Terra, which links LuaJIT with LLVM, goes the full mile and directly uses libclang to generate interfaces.

If you know a Scheme implementation that does this (including supporting a LLVM back-end in addition to a regular, possibly JIT'ed interpreter), please do not hesitate to mention!




Gambit and Chicken are near your goal, but I don't know how far you can go with it. And there's of course GNU Guile.


Neither is suitable. Guile has the wrong license, none of these three has bindings for a no-JIT code generator like LLVM.

It's no big deal though. The Scheme -> Lua compiler is small (300 lines) the dialect is better suited for hash tables and the dynamic part is mostly a driver to generate/execute machine code at runtime.

At this point, a switch to Scheme would service purism more than pragmatism. Lua is already a good Scheme VM (has been strongly inspired by Scheme, in fact) so it'll do. At least I hope it will. ;-)




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

Search: