Earlier quoted context omitted.
Lua has tail call optimization and js doesn't. For me, this is a dealbreaker for js. Lua also has operational advantages compared to javascript. You can build it from source in at most a few seconds and run it anywhere that has a c compiler. The startup time is negligible even compared to a compiled c program so you can run entire scripts that do very useful things faster than most js engines can print hello world. T…
Why is tail call optimization a dealbreaker for you? That's very specific...
The evolution of Lua, continued [pdf]
111–120 of 175 posts
Re: The evolution of Lua, continued [pdf]
#112Lua is the SQLite of program languages, absolutely blast
Lua is the glue when sh/bash doesn't suffice. Lua is simple and elegant, and I much prefer it to Tcl. Lua is in games and in LuaTeX, and when you have the choice of embedding a LISP, a FORTH or Lua in a larger application, it is often the most maintainable, runtime-efficient and low-memory footprint option of all.
Re: The evolution of Lua, continued [pdf]
#113Wish there is newer LuaJIT to leverage the new Lua features, but then maybe those new features are not really that critical.
LuaJIT is amazing. I find it insane there are no Schemes that are able to match it as a tiny, embeddable scripting language with a JITer. GNU Guile is an absolute gargantuan monster in comparison.
Re: The evolution of Lua, continued [pdf]
#114Earlier quoted context omitted.
It's a security issue. Configs are user interfaces. Devs generating configs is irrelevant.
Indeed - it would depend greatly one's workflow and threat model.
Re: The evolution of Lua, continued [pdf]
#115I was thinking a while back, how nice it would be if lua was the scripting language in the browser instead of javascript. There are some projects to compile lua to wasm and have it run in the browser... https://pluto-lang.org/web/#env=lua%3A5.4.6&code=if%20_PVERS... But interoperability with the DOM is the missing key. Still, if lua was used instead of javascript, I could see myself saying... man, I wonder what brows…
What specifically do you think would be better? Lua shares many of JS's quirks (like the relationship between arrays and non-array objects, the behavior of undefined for non-existent object properties, metatables are somewhat similar to JS prototypes, etc.) and adds a bunch more (lack of continue statement, 1-indexing, cannot have nil values in tables). I can see people liking or disliking Lua and JS both , depending…
One killer feature of Lua (that surprisingly few scripting languages have) is stackful coroutines, i.e. you can yield across nested stack frames. Unlike JS or Python, there is no artificial split between generators and async/await and no need for function coloring.
If Lua had zero-based indexing, it would be close to perfect :)
Re: The evolution of Lua, continued [pdf]
#116Earlier quoted context omitted.
What specifically do you think would be better? Lua shares many of JS's quirks (like the relationship between arrays and non-array objects, the behavior of undefined for non-existent object properties, metatables are somewhat similar to JS prototypes, etc.) and adds a bunch more (lack of continue statement, 1-indexing, cannot have nil values in tables). I can see people liking or disliking Lua and JS both , depending…
For me, JS has just too much magic, in particular the behavior of 'this', and lots of weird quirks, like "for in" vs. "for of". Lua, on the contrary, is very predictable and therfore easy to understand. One killer feature of Lua (that surprisingly few scripting languages have) is stackful coroutines, i.e. you can yield across nested stack frames. Unlike JS or Python, there is no artificial split between generators an…
"But, just write good code" you will say. Just like with Perl, some languages are designed in a way to discourage writing good code...
Re: The evolution of Lua, continued [pdf]
#117Earlier quoted context omitted.
Why do you write your years with a leading zero?
So you can instantly recognize at a glance that it's Kragen's post! ;) It's a Long Now Foundation thing: slower, deeper, longer. Y10K compliance. https://longnow.org/ideas/long-now-years-five-digit-dates-an... "The present moment used to be the unimaginable future." -Steward Brand "How can we invest in a future we know is structurally incapable of keeping faith with its past? The digital industries must shift from be…
Re: The evolution of Lua, continued [pdf]
#118Lua is the SQLite of program languages, absolutely blast
Re: The evolution of Lua, continued [pdf]
#119Earlier quoted context omitted.
I agree mostly in that Lua and Javascript are both similar, and like I said in my post above, I could see myself saying the exact opposite if Lua had been included in the browser. The things I do not like about Javascript can easily be shot down in an argument. Some of it was having to work with Javascript (and it's evil cousin JScript) in the 90s and early 00s. The type coercion and in the early days people used '==…
In practice you don't run into these issues often. I'm annoyed when you see different function declaration conventions in the same codebase, but generally () => is used for either one line functions or inline lambdas, and function foo(){} for everything else. Nobody uses var anymore. The implicit conversions is a definite footgun tho.
Re: The evolution of Lua, continued [pdf]
#120Earlier quoted context omitted.
For me, JS has just too much magic, in particular the behavior of 'this', and lots of weird quirks, like "for in" vs. "for of". Lua, on the contrary, is very predictable and therfore easy to understand. One killer feature of Lua (that surprisingly few scripting languages have) is stackful coroutines, i.e. you can yield across nested stack frames. Unlike JS or Python, there is no artificial split between generators an…
Have you read large Lua codebases written by others? It is write-only language. All your "very predictable" features are overloadable, at runtime. No static typing to rest your eye on. It is a swamp. "But, just write good code" you will say. Just like with Perl, some languages are designed in a way to discourage writing good code...
> No static typing to rest your eye on.
That goes for any dynamically typed language. How is that an argument against Lua in particular?
> Have you read large Lua codebases written by others?
No, because I use it as a scripting language, as intended. I totally agree that one shouldn't use dynamically typed languages for building large applications. But again, this is not specific to Lua.