Live data from Hacker News

The evolution of Lua, continued [pdf]

lua.org

151–160 of 175 posts

Re: The evolution of Lua, continued [pdf]

#151
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.

More like a better Objective-C, and with a syntax that was appealing to C++ developers.

https://cs.gmu.edu/~sean/stuff/java-objc.html

.NET was being designed with J++, Microsoft's Java extensions, Cool research language only became C# and took over J++'s role in .NET due to Sun's lawsuit.

The lawsuit is more than well known, and the background to .NET planned used of .NET is on the papers published by Don Syme of F# fame, regarding the history of .NET and F# HOPL.

Re: The evolution of Lua, continued [pdf]

#152
post #103
post #94

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...

Guaranteed TCO makes it practical to code recursive algorithms in natural style.

Re: The evolution of Lua, continued [pdf]

#153

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…

Fengari has DOM interop.

http://fengari.io/

It is a Lua reimplementation in JS.

Re: The evolution of Lua, continued [pdf]

#154
post #149
post #146

Earlier quoted context omitted.

Oh, as a scripting language you embed into your project so that you can write scripts for it — there is hardly anything better than Lua. The C code is super clean and easy to embed and modify. But once that project gets passed to next maintainer — I'm not sure I'd pick Lua over Forth or Scheme.

I would pick Tcl instead, but I am biased. :)

I occasionally have to write Tcl. No thanks :)

Re: The evolution of Lua, continued [pdf]

#156

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’s also a Javascript implementation of Lua which allows one to run Lua in a browser: https://github.com/fengari-lua/fengari-web I don’t know if this can access the DOM in Lua, but considering that Fengari is in Javascript, adding a _DOM global variable should not be too hard (if it hasn’t already been done).

No need for _DOM.

    local js = require "js"
    local window = js.global
    local document = window.document

    window:addEventListener("load", function()
        local el = document:getElementById("main")
        el:addEventListener("click", function(evt) js.console:log(evt.target) end
        document.body:appendChild(el)
    end

Re: The evolution of Lua, continued [pdf]

#157

My only context in using Lua is my neovim configuration, does any know of any good books or tutorials that make something more advance using only lua? Anything of note to consider/read/watch?

I absolutely love Lua and I especially love when others discover Lua and are about to embark on the amazing journey.

Here, you're gonna need this:

https://www.lua.org/gems/

Re: The evolution of Lua, continued [pdf]

#158
post #31

Lua 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.

> Lua is the glue when sh/bash doesn't suffice.

I enjoy Lua and use it professionally, but when bash (and AWK) don't suffice, the glue is Perl. Because it has pipes which you can use to connect the output of one command to the input of another, or to a file.

Re: The evolution of Lua, continued [pdf]

#159

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…

Lua has goto instead of continue.

Lua's metatables also cover a fair bit more ground than JS. For example, indexing, math operations (including bitwise), comparisons and equality can be overriden.

Post reply on HN