3 ms·
Long ago I evaluated a few scripting languages to add to a Doom engine, I think I considered Ruby, Lua, Python, JavaScript, and Squirrel. I ended up choosing Lu
by camgunz 4y ago
Long ago I evaluated a few scripting languages to add to a Doom engine, I think I considered Ruby, Lua, Python, JavaScript, and Squirrel. I ended up choosing Lua because:
- easy to embed
- good ecosystem (in particular needed Lua GObject Introspection for pangocairo)
- usable from C (not just C++)
- not white space sensitive
- skills translate to programming in the large
- it's fast
A lot of games let you write little snippets of code or what have you in a console or text box. Python is really bad at handling that because of its whitespace sensitivity. It's also the slowest popular language by far.
- pbhjpbhj 4y agoAs a non-programmer: when you say slowest, do you mean most verbose? Or, most runtime overhead? Or, something else?
- camgunz 4y agoRuntime; there are things you can do, but generally Python takes more time and memory to do things than other languages/platforms. It got better in 3.11 but AFAIK it's still the slowest.
- piva00 4y agoSlowest in runtime performance I'd guess as the CPython runtime isn't really known for its performance. Other projects such as PyPy implement a much faster interpreter/JIT compiler but there are some compatibility quirks to use them.