4 ms·
Lua definitely does not have the power of something like Python. That's usually what people like about Lua: it's barebone, yet high level and clean. If one li
by BiteCode_dev 5y ago
Lua definitely does not have the power of something like Python.
That's usually what people like about Lua: it's barebone, yet high level and clean.
If one likes Python, then the chance of liking Lua are low.
E.G:
Both python and lua can open something (a file, a socket, a transaction...) in one line.
But only Python has the `with` construct that means it's easy to guaranty you close it in case of an error.
Lua is then easier to learn: one less concept to master. But the high level tool of Python, that you had to learn, make your life easier.
They have very different trade off.
- radlad 5y ago> If one likes Python, then the chance of liking Lua are low. I don't know. I quite like both as well. The design ethos feels similar although Python has certainly added more features over the years.
- BiteCode_dev 5y ago"with" existed in python 2. In python 2.6 in fact, like comprehension lists, decorators, generators, descriptor protocol, exotic slicing assignation, advanced nested unpacking, infinite parameters... Python was always chock-full of advanced features, people just usually don't notice because they get productive in 3 days with the basic features and don't need to go further. It's has the quality of a very smooth learning curve, but a very long one if you care.
- radlad 5y ago"with" and "defer" (Go) are nice but not crucial to me.
- BiteCode_dev 5y agoMy point exactly.
- pygy_ 5y agoLua 5.4 has to-be-closed variables that are similar in functions to with blocks in python. Unkike the __gc hook which provides no guarantee as to when it will be called, if ever, the __close hook is called when a value goes out of scope. http://www.lua.org/manual/5.4/manual.html#3.3.8 http://www.lua.org/manual/5.4/manual.html#3.3.8