3 ms·
As someone that worked on LuaJIT for embeded devices (IE phones), I have some strong opinions / context. Lua is designed to be small and portable and highly em
by virtue3 6y ago
As someone that worked on LuaJIT for embeded devices (IE phones), I have some strong opinions / context.
Lua is designed to be small and portable and highly embeddable. It's not the greatest language in the world, but understanding it's interpreter and how to use it from your system side is pretty easy as these things go.
It's really REALLY well suited to be embedded into whatever system you need it in. The whole runtime is like nothing.
And it runs damn fast for an embedded language, there's like 10 opcodes or something? compared to pythons 100+ (at the time we did the comparison like 10 years ago).
Further context, I think we ported our android luaJIT to windows phone 7 in like, a day? It was super trivial.
- monocasa 6y agoI count around 100 opcodes for luajit as well. http://wiki.luajit.org/Bytecode-2.0 http://wiki.luajit.org/Bytecode-2.0 Not sure why reducing the number of ops by an under of magnitude would make it go faster.
- lrossi 6y agoEmpirically, it is much faster than Python, but I don’t know either if the opcodes have anything to do with it.
- monocasa 6y agoRight, but reducing the number of ops wouldn't get you there, that just adds more branches in the critical path as the same amount of functionality needs to be overloaded.
- mobilio 6y agoLua it's very popular on routers because it's using on some device vendors like Linksys and some opensource distributions like OpenWRT