3 ms·
If I remember correctly, one of the main original reasons was that it was super easy to embed.
by Yoric 4y ago
If I remember correctly, one of the main original reasons was that it was super easy to embed.
- paulddraper 4y agoIsn't that true of Python as well?
- camgunz 4y agoLong 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.
- david2ndaccount 4y agoIt’s not super difficult to embed python, but it ain’t easy. It is also very slow and insists on stat’ing a million files all over the disk when starting up. It’s also hard to stop python code from doing things it really shouldn’t, like calling os._exit. Oh, you also have to deal with linking against the right crt on windows.
- ClimaxGravely 4y agoI think that's definitely the reason from my talks with the engine programmers who added lua support to our bespoke engines. Lua binding is quite easy.