by programminggeek · 13y ago · 0 comments
On top of that, LuaJIT means it blows conventional languages like Ruby and Python straight out of the water. Not only is it a good language for web development, it's a remarkable one.
1. Accept Lua semantics (for example, numeric semantics) 2. Accept a (severe) performance hit in thoses cases where you want to have different semantics.
Disclaimer : I actually had this very idea and tried to make a Python to Lua compiler. Since my reason was to see if Python on LuaJit could be faster that CPython, i quickly realized this wasn't possible if you wanted to fully respect python semantics.
OTOH you could do a language that is very close to Python semantics and very close to Lua(JIT) performance, if you accept to deviate in a few points.
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.
If you're looking for a more expressive syntax, check out MoonScript. It's an awesome language that you could consider Lua's CoffeeScript analogue.
[0] http://luvit.io
Edit: Seems ray does have most of libuv features, sorry.