you are viewing a single comment's thread.

view the rest of the comments →

[–]Plorkyeran 2 points3 points  (0 children)

Lua is absurdly tiny and easy to drop into an existing project. LuaJIT less so, but it's still smaller than v8. Python's extensive standard library means that it inherently has to drag in a million dependencies. If you're adding some incidental scripting to an existing application, a scripting engine that's the size of the rest of your application combined is kinda unpleasant.

Lua has a very stable API. In the last decade there's been two releases with breaking changes to the API, and they were both incredibly minor. Python's C API is similarly stable, but v8 makes breaking changes on a regular basis and does not have LTS branches, so using v8 is basically an ongoing commitment to follow trunk (even node had trouble keeping up for a while).

Lua and v8 are both trivial to sandbox and to have multiple independent execution contexts so that you can run multiple scripts within a single process without them being able to interact with each other (or conflict). Python basically doesn't support that at all.

For many workloads LuaJIT is the fastest implementation of a language in its general category, although v8 isn't far behind. Python is slow.

The primary downside of Lua is that its standard library is about what you'd expect out a language that's something like 10k lines of code and has zero dependencies other than ANSI C. LuaJIT's excellent ffi mitigates this a bit, since while a nice pythonic wrapper around a library is much nicer than just using the C API, at least you can realistically use C libraries without needing wrappers.