Live data from Hacker News

The evolution of Lua, continued [pdf]

lua.org

71–80 of 175 posts

Re: The evolution of Lua, continued [pdf]

#71

I 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…

There is also nelua (https://nelua.io/) which can use WASM to compile allow its usage in the browser: https://github.com/edubart/nelua-game2048/

Re: The evolution of Lua, continued [pdf]

#72

I 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 on taste, but it's hard to see someone liking one and disliking the other.

Re: The evolution of Lua, continued [pdf]

#74
post #34

Earlier quoted context omitted.

A useful design pattern is to write highly efficient "engine" code in C/C++ and then tie it together to highly customizable application code with an embedded scripting language. Lua is great for this, and while you could use a LISP (Emacs, AutoCad) or a FORTH (any real-life example not from the radio telescope domain?) or Tcl/Tk ( https://wiki.tcl-lang.org/page/Who+Uses+Tcl ), Lua is small (as in number of concepts t…

The Lua-C API is also really consistent and straightforward. Bindings can be generated mechanically, of course, but it's really easy to embed by hand, and the documentation is superb.

And LLM's should be proficient in Lua and the bindings by now. That will help with velocity.

Re: The evolution of Lua, continued [pdf]

#76
post #23
post #8

It is interesting that so many of the largest languages were developed in a couple year time frame in the early-mid 90s. Python, Javascript, Java, Lua, R. All of these were developed 91-95 and make a bulk of development today.

I think that's an illusion. The language of R is S, which originated at Bell Labs in 01976. Python began development in 01989, although Guido didn't release it until 01991. And the top 20 on https://www.tiobe.com/tiobe-index/ are Python, C (01972?), C++ (01982?), Java, C# (01999? though arguably it's just a dialect of Java), JS, Visual Basic (first released 01991, within your window), Golang (02007), Delphi (under th…

I do agree with your point but I also think that there is a lot of inertia in the sector (rightfully so!) and it is very difficult for languages to become established if they don't come with a "unique selling point" of sorts, which to me explains how new popular languages have become rarer.

That selling point, for Lua, is the super easy integration via C-API to me (=> making existing compiled applications scriptable), thanks to uncomplicated build (dependency free, simple), the straightforward C-API and the ease of exposing C "modules" to Lua.

On a sidenote:

Don't you think that Y10k-safe dates are somewhat inconsistent with referencing previous decades directly? Those dates are also obnoxious to parse for humans (myself, at least).

Re: The evolution of Lua, continued [pdf]

#77

I 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…

I held a similar opinion several years ago. The main thing is that lua has less magic than js largely because it's been allowed to break compatibility.

My main example is self in lua which is just the first argument of a function with some syntactic sugar vs this in javascript which especially before 'bind' often tripped people up. The coercion rules are also simpler largely by virtue of making 0 true.

Re: The evolution of Lua, continued [pdf]

#78
post #23
post #8

It is interesting that so many of the largest languages were developed in a couple year time frame in the early-mid 90s. Python, Javascript, Java, Lua, R. All of these were developed 91-95 and make a bulk of development today.

I think that's an illusion. The language of R is S, which originated at Bell Labs in 01976. Python began development in 01989, although Guido didn't release it until 01991. And the top 20 on https://www.tiobe.com/tiobe-index/ are Python, C (01972?), C++ (01982?), Java, C# (01999? though arguably it's just a dialect of Java), JS, Visual Basic (first released 01991, within your window), Golang (02007), Delphi (under th…

>C# (01999? though arguably it's just a dialect of Java)

That's like saying Java is a dialect of C++. Java was specifically designed as a "fuck you" to C++, and C# was specifically designed as a "fuck you" to Java.

Re: The evolution of Lua, continued [pdf]

#80
post #23

Earlier quoted context omitted.

I think that's an illusion. The language of R is S, which originated at Bell Labs in 01976. Python began development in 01989, although Guido didn't release it until 01991. And the top 20 on https://www.tiobe.com/tiobe-index/ are Python, C (01972?), C++ (01982?), Java, C# (01999? though arguably it's just a dialect of Java), JS, Visual Basic (first released 01991, within your window), Golang (02007), Delphi (under th…

>C# (01999? though arguably it's just a dialect of Java) That's like saying Java is a dialect of C++. Java was specifically designed as a "fuck you" to C++, and C# was specifically designed as a "fuck you" to Java.

While at a political level that's reasonable, at both the semantic and the syntactic level, the first version of C# was very close to Java, much closer than the first version of Java was to C++. https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/cs... is a very vague overview.
Post reply on HN