Live data from Hacker News

Fengari – Lua for the Browser

fengari.io

41–50 of 145 posts

Re: Fengari – Lua for the Browser

#43

Lua is the only language I can truly say I love. If more people used it (and used it responsibly, not letting it become a mess of odd libraries), the world would be a better place.

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, but I think somewhere under the cruft of JS is a good language. The syntax is dead simple, functions are first class, and with something like TS you can get static typing ontop of all of that.

Re: Fengari – Lua for the Browser

#44
post #5

After I found fennel-lang I thought "all I need now is a browser that runs Lua" and now here we are, I hope they work together well. Thanks for this OP

A similar (and very mature) project similar to this is BiwaScheme: https://www.biwascheme.org/index.html

It's a Scheme interpreter in Javascript that implements IIRC most of R6RS and is working on R7RS.

Re: Fengari – Lua for the Browser

#45
post #18

For those looking for powerful async coroutines in the browser: The combination of typescript+redux+redux-saga is also quite powerful. Redux-saga uses generator coroutines to handle all sorts of asynchronous tasks.

I think you can do anything in Redux Saga without either Redux or React.

I think you can do anything in Javascript without either Redux Saga or Redux or React.

Re: Fengari – Lua for the Browser

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

That's not really confusing though, just takes a bit of unlearning the muscle memory of 0-based indexing.

Re: Fengari – Lua for the Browser

#48

Lua did a language fork at version 5.3. I think this supports the 5.3 fork but it would be good to make this explicit.

Lua 5.3’s not really a fork. It just has backwards-incompatible changes, as do 5.1, 5.2 and 5.4.

Otherwise yes, “Fengari implements Lua 5.3”. https://github.com/fengari-lua/fengari

Re: Fengari – Lua for the Browser

#49

Lua did a language fork at version 5.3. I think this supports the 5.3 fork but it would be good to make this explicit.

I'm not entirely sure what you mean by "language fork", but all versions of Lua have incompatibilities. 5.1, 5.2, 5.3, and 5.4 are all major versions, with features that aren't completely compatible with any of the others.

For example, 5.2 brought in major changes for how environments were handled, and 5.3 brought in integers, and 5.4 brought in changes to how number overflow is handled.

Re: Fengari – Lua for the Browser

#50
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,…

Decades later you may believe that "everybody" uses "===", but actually "==" is still there, and many people still use that regardless of what you choose to believe, simply because it's there and 33% shorter and looks like C and Stackoverflow is full of examples of it, and it STILL commonly causes many subtle hard-to-find bugs.

People like Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes, James Gosling, Guido van Rossum, and Anders Hejlsberg are enlightened, experienced programming language designers who actually know what they're doing, and they don't make stupid amateur-hour mistakes like JavaScript was cursed and riddled with from day one, that make it difficult for compilers to optimize code, and which we're still using tooling and linters and IDEs and compilers to work around, because they're still in the language and will never go away.

"My favorite is always the billion dollar mistake of having null in the language. And since JavaScript has both null and undefined, it's the two billion dollar mistake." -Anders Hejlsberg

"It is by far the most problematic part of language design. And it's a single value that -- ha ha ha ha -- that if only that wasn't there, imagine all the problems we wouldn't have, right? If type systems were designed that way. And some type systems are, and some type systems are getting there, but boy, trying to retrofit that on top of a type system that has null in the first place is quite an undertaking." -Anders Hejlsberg

But you also missed the reference to how deeply and tragically confused the bigoted designer of JavaScript is about equality when it comes to human beings, not just programming languages. And the terrible damage his confusion about equality and his promotion of inequality did to Mozilla and his co-workers and his own reputation and legacy.

I love what JavaScript finally evolved into after decades of intense development and revision and optimization, which took the precious time and effort of uncountable extremely talented people, but all that effort that was pissed away working around JavaScript's original stupid unforced flaws could have been applied in so many much more productive and useful ways, instead of wasted the way it was, and the world would be a much better place if a language like Lua that wasn't so naively and incoherently designed in the first place was used instead of JavaScript.

Post reply on HN