4 ms·
Is Lua the new in vogue programming language?
by diskcat 11y ago
Is Lua the new in vogue programming language?
- otabdeveloper 11y agoLua has been the standard extension language in gamedev and adtech for years and years.
- wmt 11y agoIt was in the 90s, especially after the Dr Dobbs article about it, and tons of late 90s and early 2000s games, like Grim Fandango, Baldurs Gate and Escape from Monkey Island used Lua due to its hotness.
- ewmailing 11y agoActually, Grim Fandango was the very first known game to use Lua and wasn't due to any hotness. Bret Mogilefsky, who against skepticism, dared to try to create a new scripting engine to replace the aging SCUMM engine. He was given the Dr. Dobbs article by a colleague and things came together. After the technical success of Grim Fandango, it was applied to Escape from Monkey Island. A few years(?) later at GDC, there was a 2 hour session to discuss scripting in games. Near the end, after everybody was depressed with no viable solutions, Bret's colleague exclaimed, "Or you can do what Bret did" and he was dragged up on stage. Bret gave an impromptu spiel about what Lua was and how they used it at LucasArts. Everybody else frantically scribbled down notes and that was how the video game industry adopted Lua as the dominant game scripting language. *Source: Bret Mogilefsky's talk at the very first Lua Workshop in 2005
- haberman 11y agoLua is a simple and only slightly quirky (1-based arrays) dynamic programming language. It has exceptionally small and high quality implementations in Lua and LuaJIT. It has very good documentation. Its main downside is that the language changes in backward-compatible ways between releases. And worse, LuaJIT has in some sense forked the language. Lua 5.3 introduced integer support, but there are no plans to add this to LuaJIT AFAIK.
- vbit 11y agoThe 1-based indexing isn't particularly bothersome. It's the method vs. function determination at call site combined with default nil for unspecified arguments that really gets you.
- haberman 11y agoI've never had any problem with the two things you mentioned.
- jnbiche 11y ago> default nil for unspecified arguments Isn't this what most scripting languages do? I know it's the case with Python and PHP. And I disagree about the 1-based array indexing. With algorithms that require a lot of 1-off values, it can be a huge pain in the ass, particularly if you're trying to integrate it with C (and its 0-based array indexing). Still not sure why the creators chose it, given that Lua was designed for easy and close C interop.
- ewmailing 11y agoWhy? From one of Roberto Ierusalimschy's talks (starts at slide 6): http://www.inf.puc-rio.br/%7Eroberto/talks/ws2011.pdf http://www.inf.puc-rio.br/%7Eroberto/talks/ws2011.pdf Excerpt: - Not all languages are 0-based: Icon, Fortran, AWK1, and Smalltalk are 1-based; Snobol, Pascal, Modula, Modula-32, and Ada have configurable bases. - Currently, many languages are 0-based due to influence from C. - Ironically, none of them share the reason that made C 0-based (where a[e] means *(a+e)). 1-based arrays: - Much more intuitive: first is 1st (not 0th). ISO-C: “E1[E2] designates the E2-th element of E1 (counting from zero).” - Much easier for non programmers. Easy for (good) programmers :) - Historical reason: Fortran used 1-based arrays, and most first users of Lua had a Fortran background.
- kbd 11y agoThe presentation asserts that 0-based arrays have "More interesting mathematical properties". Dijkstra's classic paper on this is a must-read: http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF
- mtw 11y agoI'm interested in it because the machine learning library Torch is using it (and by extension Facebook and other big tech companies). It's also one of the fastest dynamic languages for web applications