4 ms·
Absolutely right. The Lua implementation was definitely its strong point, and LuaJIT is reportedly extremely good as well. I say “was” because the circumstance
by klodolph 6y ago
Absolutely right.
The Lua implementation was definitely its strong point, and LuaJIT is reportedly extremely good as well. I say “was” because the circumstances have changed and there are much better alternatives around.
Circa 2000 or so, if you wanted to stick a simple, self-contained language in your app for extensions and scripting, Lua was one of the very few reasonable choices. There are a ton of reasons why you might not want to stick TCL, Guile, or Python inside your application.
So Lua was used not only in the WoW UI but in a bunch of other apps from that era, and gained a lot of social traction that way. Among other things, if you were making a game, Lua let your level designers and UX people write a little bit of code without having to get their hands dirty with C++ (which nobody wants). The language is very off-putting otherwise.
- makapuf 6y ago> there are much better alternatives around. Coule you give some examples ?
- klodolph 6y agoThis is gonna be subjective, because it depends on what your priorities are. The two alternatives at the top of my list are Gravity and Wren. They are both designed for the same general profile that Lua has—a scripting language, safe to use, embeddable, with a small VM (low code size). - https://github.com/marcobambini/gravity https://github.com/marcobambini/gravity - https://wren.io/ https://wren.io/ The language design choices are nice and familiar to people who are used to other existing languages. Lua is a bit radical. Two other options are AngelScript and Squirrel, which are both a bit older and more mature than Gravity and Wren. - http://www.angelcode.com/angelscript/ http://www.angelcode.com/angelscript/ - http://squirrel-lang.org/ http://squirrel-lang.org/ Finally, it’s much more feasible these days to embed something like Mono, and Guile has gotten a lot better.
- bch 6y ago> Lua was one of the very few reasonable choices. There are a ton of reasons why you might not want to stick TCL, Guile, or Python inside your application. That sounds quite editorial - can you list some of the “ton of reasons”? C. 2000 Tcl was already 12 years old, received a major performance upgrade w 8.4[0], and was liberally licensed. [0] https://www.linux.com/news/tcltk-840-release-announcement/ https://www.linux.com/news/tcltk-840-release-announcement/
- klodolph 6y agoIt seems like people have forgotten how bad TCL is, as a language. Everything is a string, except variables, which can be arrays of strings. You want a number? String. You want an object? String. You want a data structure? String. TCL is a bad choice for almost anything. It is only marginally more usable than using a shell. It seems like the only reason you would use TCL is so you could throw together a GUI in front of a command-line program, or maybe stick a very bare-bones scripting interface inside something else.
- detaro 6y ago"luckily", someone created cmake so younger generations get to experience this problem too...
- klodolph 6y agoCMake is definitely worse than TCL, having used both.
- nrclark 6y agoI wrote a lot of TCL code in 2015-2017, and it was better than I thought going into it. TCL has first-class lists and maps, and they're not string-based under the hood at all. It's true that TCL was "all string all the time" in the early days, but now it's more like Python - you represent those types as a string, but that's not the internal storage. I think TCL gets a really bad rap. Once you get past the unusual syntax, it's pretty nice to work in. Almost Python level nice. It supports classes, exceptions, first-class functions, and has some concepts I've never seen in other languages (such as upvar). It's easy to embed, or easy to use standalone. Installation is small and portable. And it feels like if Lisp and Bash had a baby together, conceived with love. TCL in 2005 might have been a beast. TCL in 2020 is way better than you might expect. And it persists also, with a stable ecosystem as an embedded language in various CAD/EDA tools.