4 ms·
Yes. I once thought about cheating my way to "the fastest Ruby implementation ever" by simply compiling Ruby to Lua and handing the result to LuaJIT. Many peop
by copx 13y ago
Yes. I once thought about cheating my way to "the fastest Ruby implementation ever" by simply compiling Ruby to Lua and handing the result to LuaJIT.
Many people "compile to C" if they just want to write some personal toy language or an experimental language. I think "compile to Lua" would be a superior alternative in many cases.
One should point out that this way you get an incremental garbage collector for free, one whose behavior can easily be controlled at runtime i.e. good for soft real-time applications (e.g. games).
Also both Lua and LuaJIT are very lightweight which means you can simply bundle the complete language implementation when creating standalone binaries. On Windows x86 Lua5.1 is ~308kb compiled, LuaJIT2 ~340kb.
- burntsushi 13y agoHave you heard of Terra[1]? I think it was pretty much designed for what you're saying. :-) The cool thing is that the project looks really active too.[2] [1] - http://terralang.org http://terralang.org [2] - https://github.com/zdevito/terra/commits/master https://github.com/zdevito/terra/commits/master
- sitkack 13y agoOne could make a Lua backend to PyPy? :) Lua 5.2 has a nice `goto` which makes things very easy. Esp with builtin TCO.