Live data from Hacker News

Fengari – Lua for the Browser

fengari.io

31–40 of 145 posts

Re: Fengari – Lua for the Browser

#31
post #22

Earlier quoted context omitted.

> So this is a scripting language on top of a scripting language? It's a bit sad. What a low-effort takedown. Why don't you at least explain why it's such a sad idea? > The idea is cool, but why wasn't it implemented w/ wasm? How are you planning to interact with the DOM with WASM? Sounds like you know enough to criticize yet don't understand your proposed alternative enough to know why it wouldn't work.

Via https://github.com/mbasso/asm-dom ? (for example). For every complex self generated challenge there is an even more complex solution?

This is a virtual domain implementation, like React, not interacting with the actual DOM like the demo in the OP. WASM is awesome, but seems like folks don't really understand it and the limitations.

I bet DOM access in WASM is totally doable, just gonna be a lot harder than how this project implemented it.

Re: Fengari – Lua for the Browser

#33
post #29

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.

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

Not OP, but for me, I love Lua because it’s both easy-to-use and simple. Python is the former and Go is the latter, but I don’t know any other mainstream language that’s both.

Re: Fengari – Lua for the Browser

#34
post #29

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.

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

Re: Fengari – Lua for the Browser

#36

> Lua in the browser means you can use coroutines to write beautiful asynchronous code Is it beautiful, but also performant?

I wonder the same thing. Writing a scripting language on top of another scripting language makes me wonder, why add another layer? A common complaint I have seen with frontend JS apps is that people tend to unnecessarily bloat them.

But I do appreciate the efforts and idea. Most probably the developers must have thought this through and have definitely kept the performance aspect in mind.

Re: Fengari – Lua for the Browser

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

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

Re: Fengari – Lua for the Browser

#38

So this is a scripting language on top of a scripting language? It's a bit sad. The idea is cool, but why wasn't it implemented w/ wasm?

Do tell, what's your definition of a "scripting language" anyway, and what is it about that definition that implies you shouldn't be happy about implementing one scripting language in another scripting language?

Especially when the hosted scripting language can take advantage of the garbage collection and the incredible amount of optimizations that have been put into the hosting scripting language.

You know there's a reason people have put so much time and effort into optimizing JavaScript. Is there a reason it's sad to take advantage of that?

Or would it make you happier if everyone wrote their own garbage collectors and optimizing JIT compilers and portable operating system independent runtimes from scratch every time?

Re: Fengari – Lua for the Browser

#40

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 Scheme or Dylan with "normal" infix syntax and a CLOS-like OOP system) to JavaScript.

If all the time and effort and treasure that was wasted cobbling together JavaScript from scratch with all its naive unforced design flaws and security holes and interoperability issues -- and then everyone else pissing away so much effort working around and fixing subtle bugs in JavaScript code due to those terrible design flaws (cough cough "this" cough cough "equality") -- had been put into Lua instead, which was cleanly designed from the start by incredibly smart people who actually had a clue about what they were doing, the world would be a much better place.

People who are that confused about equality shouldn't design programming languages:

https://dorey.github.io/JavaScript-Equality-Table/

"All animals are equal, but some animals are more equal than others." -George Orwell, Animal Farm

https://news.ycombinator.com/item?id=29379272

>For Netscape in 1995, I believe Python would have been a better choice than JavaScript, but Lua would have been an even better choice, given how much smaller, simpler, and more efficient Lua is, and the eventual excellence of LuaJIT. (If only Lua indexed its array from 0 instead of 1...) But Python and Lua didn't "look like Java" enough for Netscape.

https://news.ycombinator.com/item?id=17061967

[...]

>But if not PostScript, Python, or Lua, then at least Netscape didn't use TCL in the browser. Around 1994, long after NeWS and right before Java, Sun announced they were going to make TCL the official scripting language of the world wide web, which triggered RMS into kicking off the Great TCL War:

>RMS's "Why you should not use Tcl" flame:

https://wiki.tcl.tk/16730

https://news.ycombinator.com/item?id=17061858

>And with that diplomatically worded message, RMS kicked of The Infamous TCL War. That was Stallman's response to Sun bombastically pushing TCL as the official scripting language of the web, BEFORE Live Oak / Java was a widely known (or evangelized) thing.

>At the point anybody started talking about a Java/TCL bridge, it was already all over for TCL becoming the "ubiquitous scripting language of the Internet".

>Sun's unilateral anointment of TCL as the official Internet scripting language trigged RMS's "Why you should not use Tcl" message, which triggered the TCL War, which triggered Sun to switch to Java.

>After the TCL war finally subsided, Sun quietly pushed TCL aside and loudly evangelize Java instead. The TCL community was quite flustered and disappointed after first winning the title "ubiquitous scripting language of the Internet" and then having the title yanked away and given to Java.

>Any talk of bridges were just table scraps for TCL, the redheaded bastard stepchild sitting outside on the back porch in the rain, smoking a cigarette and commiserating with NeWS and Self.

>Tom Lord's description of what happened is insightful and accurate:

https://web.archive.org/web/20110102015130/http://basiscraft...

Post reply on HN