by kragen · 2y ago · 0 comments
the good:
- string interpolation
- a continue statement
- conditional expressions
- augmented assignment
- frozen tables
- some kind of static typing?
the bad:
- much worse documentation
- no luajit
- you can't compile without c++‽ that's the opposite extreme from 'retains the easy embeddability of Lua'
- and wtf, a build system in php? the nope level is rising rapidly
- you still index from 1
- variables are still global by default
- misspelling a variable or property still gives you nil instead of throwing an exception
- aping c++/java syntax and semantics for classes and class instantiation
- redundant aliases for operators
- a redundant mechanism for private fields
- dwim for for-in on a table
it seems like a c++ or perl programmer didn't understand what was good about lua and decided to make it look like perl
Isn't that the whole point of "frozen tables", which you listed as "good"? For globals, freeze `_G` and/or `_ENV`.
I cannot even imagine how pattern matching will work when it always returns nil, not to mention tables are full of nil sometimes, it would be an incredible waste to have a table full of false instead of nil.
Conditional expression which I imagine is ternaries can be done with a constructor and the condition in the field a la {nil,"b"}[cond and 1 or 2]