Live data from Hacker News

Fengari – Lua for the Browser

fengari.io

51–60 of 145 posts

Re: Fengari – Lua for the Browser

#51
post #29

Earlier quoted context omitted.

> Lua is the only language I can truly say I love Why? I've worked with Lua before and to me it's not a bad language, but nothing special either. I'm honestly wondering.

It has all the power of something like Python, but is much faster and with far less cruft and basically no confusing elements. You’re given a small set of tools and it’s incredibly easy to build off them.

Why would Lua be significantly faster than Python? Isn't it an interpreted language too?

Re: Fengari – Lua for the Browser

#52
post #28

No web assembly?

Presumably you would load wasm modules with this, as it is just a js VM. Couldn't find a defined browser API, but if the promise of general interoperability holds, then I imagine loading wasm will work like it normally does, just using lua.

Re: Fengari – Lua for the Browser

#53
post #29

Earlier quoted context omitted.

> Lua is the only language I can truly say I love Why? I've worked with Lua before and to me it's not a bad language, but nothing special either. I'm honestly wondering.

It has all the power of something like Python, but is much faster and with far less cruft and basically no confusing elements. You’re given a small set of tools and it’s incredibly easy to build off them.

Isn't it LuaJIT that's really fast? Last I remember reading about it, there was some version fragmentation going on with Lua advancing and LuaJIT stuck on an older version? (That was a long time ago, and I don't know what been happening since.)

Re: Fengari – Lua for the Browser

#54
post #43

Earlier quoted context omitted.

I wish Netscape had chosen Lua instead of bothering to invent JavaScript. Python would have also been much better than JavaScript, but Lua would have been perfect. But at least they didn't choose TCL, as Sun was pushing before they switched gears to Java after the Great TCL War. And personally, I would have preferred PostScript (which was the basis of NeWS, with a Smalltalk-like OOP system) or ScriptX (which was like…

> People who are confused about equality shouldn't design programming languages: This is a very dull criticism of JavaScript, everybody uses ===. While it's definitely true the language has some poor decisions (`with`, `==`, etc.). You can write JS without using any of these features (and almost everyone does). Infact, just using a decently strict ESLint config will get you most of the way there. It's controversial,…

I think your answer just solidifies their point since your proposed solutions are to avoid parts of the language and bolt two pieces of tooling on top.

Re: Fengari – Lua for the Browser

#55
post #37

Earlier quoted context omitted.

It has all the power of something like Python, but is much faster and with far less cruft and basically no confusing elements. You’re given a small set of tools and it’s incredibly easy to build off them.

> basically no confusing elements. the one confusing element - one-based indexing of arrays! that is something i found hard to adjust, as it makes off-by-one errors more prominent... but otherwise it's a nice language.

I certainly prefer 0-indexed these days, but starting on 1-indexed languages (A variety of BASIC’s) I found 0-indexing just as weird.

Re: Fengari – Lua for the Browser

#56
post #51

Earlier quoted context omitted.

It has all the power of something like Python, but is much faster and with far less cruft and basically no confusing elements. You’re given a small set of tools and it’s incredibly easy to build off them.

Why would Lua be significantly faster than Python? Isn't it an interpreted language too?

The JIT version of LUA, according to some benchmarks I just saw, is similar to C in performance.

Re: Fengari – Lua for the Browser

#57
post #51

Earlier quoted context omitted.

It has all the power of something like Python, but is much faster and with far less cruft and basically no confusing elements. You’re given a small set of tools and it’s incredibly easy to build off them.

Why would Lua be significantly faster than Python? Isn't it an interpreted language too?

The Lua interpreter is really lightweight, and for decades has been the go to choice for when you need dynamic code and speed (for example, it's been popular in the games industry for this reason).

Probably someone else can shed light on exact numbers, but Lua is faster than Python.

Re: Fengari – Lua for the Browser

#58

Earlier quoted context omitted.

It has all the power of something like Python, but is much faster and with far less cruft and basically no confusing elements. You’re given a small set of tools and it’s incredibly easy to build off them.

Isn't it LuaJIT that's really fast? Last I remember reading about it, there was some version fragmentation going on with Lua advancing and LuaJIT stuck on an older version? (That was a long time ago, and I don't know what been happening since.)

Yes, Lua’s now on version 5.4 and LuaJIT is stuck half-way between 5.1 and 5.2.

Re: Fengari – Lua for the Browser

#59
post #43

Earlier quoted context omitted.

I wish Netscape had chosen Lua instead of bothering to invent JavaScript. Python would have also been much better than JavaScript, but Lua would have been perfect. But at least they didn't choose TCL, as Sun was pushing before they switched gears to Java after the Great TCL War. And personally, I would have preferred PostScript (which was the basis of NeWS, with a Smalltalk-like OOP system) or ScriptX (which was like…

> People who are confused about equality shouldn't design programming languages: This is a very dull criticism of JavaScript, everybody uses ===. While it's definitely true the language has some poor decisions (`with`, `==`, etc.). You can write JS without using any of these features (and almost everyone does). Infact, just using a decently strict ESLint config will get you most of the way there. It's controversial,…

I’ve used JavaScript for about 25 years, sometimes more seriously, and always hated it. I’ve always found it unpredictable, I don’t like the turtles-all-the-way-down thing going on with its objects. I’d like to leverage my experience with regular class definitions and instantiation from Java workalikes. I’m sure many people love JS’s take on OO but I find it annoying.

A perfect example: I read hey there’s a cool simpler way to write small anonymous functions called arrow syntax. Nice let me try it, hm it’s not working —> google —> arrow functions have no access to ‘this’.

Re: Fengari – Lua for the Browser

#60
post #37

Earlier quoted context omitted.

It has all the power of something like Python, but is much faster and with far less cruft and basically no confusing elements. You’re given a small set of tools and it’s incredibly easy to build off them.

> basically no confusing elements. the one confusing element - one-based indexing of arrays! that is something i found hard to adjust, as it makes off-by-one errors more prominent... but otherwise it's a nice language.

I agree, that's the one unfortunate flaw of Lua I'd go back in time and change if I were Hitler With a Time Machine, but I've used Lua and other 1-based languages like ScriptX, and you totally get used to it, and finally realize that 0-based languages have their own confusing quirks and inconveniences that you got used to when you learned them, and you just don't think about them any more once you've internalized them, just like 1-based languages. It's just a matter of moving the confusing quirks and complexity around, not that 0-based languages are less confusing, complex, or quirky than 1-based languages, or the other way around.

But that said, I'd prefer that Lua had 0-based indexes, simply because that's what most other languages have, not because it's superior.

Post reply on HN