4 ms·
Lua's simplicity is sometimes it's real selling point. I was just today searching for a small scripting language to implement in a mobile app in .net, where app
by ivoras 4y ago
Lua's simplicity is sometimes it's real selling point. I was just today searching for a small scripting language to implement in a mobile app in .net, where app size is a premium, and it turns out that the smallest useful JavaScript interpreter is at least 3x the size of a Lua interpreter.
I do believe that an un-bloated JavaScript language from when it was just invented would be simpler than Lua (as both were designed as "scripting" languages, not as main ones), but history didn't go that route :)
But... Lua is WEIRD! Weird nomenclature, weird string concatenation operand, 1-based arrays, too clever "tables" and "metatables" stuff.
- Lyngbakr 4y agoWeird? :) Surely all languages have their idiosyncrasies otherwise there'd be so very few to choose from? I mean, 1-based arrays can be found in several popular languages like R, Julia, & MATLAB. Taking the opposite perspective: there's so much in Lua that is familiar. I'd argue that coders who have never used it before could easily make sense of a Lua program. (I'll give you metatables, though — they're a bit unusual!)
- vvanders 4y agoTables + metatables are awesome, I've seen full OOP, composition based design various forms of dynamic dispatch all built on those simple mechanisms. One fun thing we did with co-routines was build literate-style scripting for our designers to define AI routines. They could write them in a linear/semi linear way with yield(<number of frames to wait to re-execute>) that allowed them to script all sorts of interesting behaviors without extensive programming knowledge. We also ran the whole thing inside a 400kb pre-allocated block, it's an incredible powerful, embeddable language.
- xanathar 4y agoThe concatenation operand makes sense though... String concatenation is hardly addition and for weakly typed languages it's easy for the + operator to end up doing the wrong thing instead of failing. Out of curiosity: what Lua interpreter did you pick for your .net project?