News for hackers. Stuff that matters.
Re:Lua, a Misunderstood Language by virtue3 on Friday January 15, 2021 @05:01PM (#25797123)
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.

Re:Lua, a Misunderstood Language by monocasa on Friday January 15, 2021 @05:10PM (#25797214)
I count around 100 opcodes for luajit as well.

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.

Re:Lua, a Misunderstood Language by lrossi on Friday January 15, 2021 @05:41PM (#25797511)
Empirically, it is much faster than Python, but I don’t know either if the opcodes have anything to do with it.
Re:Lua, a Misunderstood Language by monocasa on Friday January 15, 2021 @05:48PM (#25797567)
Right, 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.
Re:Lua, a Misunderstood Language by mobilio on Friday January 15, 2021 @05:54PM (#25797631)
Lua it's very popular on routers because it's using on some device vendors like Linksys and some opensource distributions like OpenWRT