Live data from Hacker News

Fengari – Lua for the Browser

fengari.io

21–30 of 145 posts

Re: Fengari – Lua for the Browser

#21

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?

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

Re: Fengari – Lua for the Browser

#22

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?

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

Re: Fengari – Lua for the Browser

#25

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?

Wasm doesn’t have any built in garbage collector (yet) and so by building on top of Javascript (especially for a language like Lua that has a lot of alignment with it) you are reusing that machinery which is easer.

True you could take an existing lua implementation and compile to WASM but then as the other comment explained interacting with the DOM would need to be implemented.

Re: Fengari – Lua for the Browser

#27

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?

I remember seeing lua for the browser quite some years ago (not sure if it was fengari or not) that worked similarly (include the script and then anything of type `application/lua` would execute using it). I ran into it in 2014.

If fengari is that, then I think it predates wasm.

Edit: it is not, since my memory is from 2014. However, the git history says fengari was started 5 years ago and wikipedia says wasm came out 4 years ago.

Re: Fengari – Lua for the Browser

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

Re: Fengari – Lua for the Browser

#30
post #28

No web assembly?

Not sure why'd you think this would have anything to do with WASM, the homepage is really clear what this is:

> Fengari is the Lua VM written in JavaScript. It uses JavaScript's garbage collector so that interoperability with the DOM is non-leaky.

WASM wouldn't use JS's GC, nor would provide interop with the DOM, so for the stated goals of this project, WASM would be a non-starter.

There is prior art for Lua -> WASM in case you're interested in that: https://github.com/ysugimoto/webassembly-lua

Post reply on HN