Skip to content

Comment on Wasm3 compiles itself (using LLVM/Clang compiled to WASM)parent

Comments

It seems like it's headed that way. At the moment, it's only really practical to generate WASM from compiled languages, or really small languages, like Lua. And your interfaces to the browser (and thus, the outside world) itself are pretty limited, so still lots of javascript involved.

Can confirm that Lua does run in WASM in the browser: https://github.com/vvanders/wasm_lua

I sometimes wonder what the world would be like if Lua had zero based indices and saw a bit broader adoption. It's such an easy language to embed/extends although QuickJS looks like it's going to give it a run for the money in the long term given the similar goals on ease of embedding.

I wonder if anyone has compiled QuickJS to WASM and run it in the browser.

I wonder if anyone has compiled QuickJS to WASM and run it in the browser.

Fabrice Bellard actually did it himself here: http://numcalc.com/

If your language is supported by LLVM, then Emscripten can compile it to WASM.

Yes, but for interpreted language 'X', are the created artifacts of a practical size to send down the wire for an actual production site? The idea being that as WASM adds higher level primitives, that size gets smaller.

Sorry, I misread your comment. I thought you wrote that only "small languages", or Lua, can be compiled to WASM.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.