top | item 46853434

(no title)

mastermage | 28 days ago

I still do not understand how Python won out over lua. Which is imho the superior scripting language just constrained by a smaller userbase. Lua is like embeddable in what 500 KiB. While python takes its about 200 to 300 MiB

discuss

order

zelphirkalt|28 days ago

I think Lua is an interesting language and I really like it having TCO, so that I can properly write recursive logic like in a Scheme. However, I am somewhat worried about data structures. When I read about Lua, it always seems quite thin on that front. On the other hand I just looked up Lua data structures and found a book called "Programming in Lua" and the first page I read was about "tables", which I assume to be something like dictionaries in Python, and it says that arrays and others are implemented on top of "tables". What about immutable data structures? Are there libraries for purely functional data structures? How complete are they?

These things I don't usually look up for Python, because Python is clearly not a very functional language and doesn't have the immutable data structures at all, and doesn't even feature TCO, so basically Python is mostly lost, when it comes to doing FP, and I accept, that it is not really that kind of language. I only try to use FP knowledge to avoid common pitfalls, when coding in Python. But from Lua I would expect better.

teunispeters|27 days ago

No viral license in Python, very easy to link to libraries with python.

not sure which means more, but the second is definitely critical.

SR2Z|27 days ago

Lua has lots of ugly syntax and is 1-indexed. That's probably the only reason it never took off.

mrighele|27 days ago

I don't think being 1-indexed is what made the reason.

While it was already in widespread use, Python really took off in the scientific/research community, thanks first to numpy and then to all the other libraries built on top of it up to the current crop of ML/AI libraries.

Those people used to write a lot code in Fortran, Matlab and R (depending on their research area) which are all 1-indexed.

pjmlp|28 days ago

Batteries included and a more sane language.

Also Lua is kind of frozen in version 5.1, if one cares about performace, while even if CPython only recently got JIT love, there are several other alternatives.