Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If I remember correctly, one of the main original reasons was that it was super easy to embed.


I 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.


Isn't that true of Python as well?


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.


As a non-programmer: when you say slowest, do you mean most verbose? Or, most runtime overhead? Or, something else?


Slowest 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.


Runtime; 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.


Thanks.


No prob! :)


It’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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: