News for hackers. Stuff that matters.
Re:Wazero: The zero dependency WebAssembly runtime for Go de... by Shadonototra on Tuesday May 17, 2022 @05:07AM (#31407758)
So far Zig, Odin and Go are the best languages for WASM

C/C++ is a solid choice too thanks to EMSCRIPEN, but it is very slow to compile, and is not very clean solution

dotnet is just too big for WASM

rust is too complicated slow to program with

Re:Wazero: The zero dependency WebAssembly runtime for Go de... by moonchrome on Tuesday May 17, 2022 @06:41AM (#31408492)
This is a WASM runtime/interpreter written in Go - not a Go compiler/runtime for WASM.
Re:Wazero: The zero dependency WebAssembly runtime for Go de... by mamidon on Tuesday May 17, 2022 @01:04PM (#31413553)
I've heard about wasm native gc for years. How can I see the actual status of the proposal?

I'm not sure if they're actually working on it or blocked for some reason

Re:Wazero: The zero dependency WebAssembly runtime for Go de... by adrianfcole on Tuesday May 17, 2022 @01:24PM (#31413777)
There's a proposals repo [1] that tracks the status of features like GC. According to that, GC is phase 2, which is prototyping [2]. To get to the finish line, implementations including at least 2 browsers need to happen (this is a Web standard, so there's some browser bias in the process). It is not straight forward to see who and what are implementing a proposal, especially if not tracked in the roadmap [3]. Best advice I could give for now is to watch the proposal repo [4], or just wait. It may be a while on this one.

[1]: https://github.com/WebAssembly/proposals [2]: https://github.com/WebAssembly/meetings/blob/main/process/ph... [3]: https://webassembly.org/roadmap/ [4]: https://github.com/WebAssembly/gc

Re:Wazero: The zero dependency WebAssembly runtime for Go de... by kaba0 on Tuesday May 17, 2022 @09:12AM (#31410021)
Go has a runtime that has to be included, with GC running alongside the app. So no, it is not at all a good fit for Wasm, until the latter’s GC proposal gets finalized.
Re:Wazero: The zero dependency WebAssembly runtime for Go de... by adrianfcole on Tuesday May 17, 2022 @11:07AM (#31411828)
(wazero maintainer) we have a popular allocation example, which shows how GC ends up embedded (really malloc/free) in wasm produced by Rust or TinyGo. You are right that whatever produces wasm, if needs to allocate memory, is doing that by embedding some implementation into the wasm (during compilation).

[1] https://github.com/tetratelabs/wazero/tree/main/examples/all...

Re:Wazero: The zero dependency WebAssembly runtime for Go de... by jedisct1 on Tuesday May 17, 2022 @07:33PM (#31417477)
> it is very slow to compile

Emscripten is amazing if you need a full POSIX environment in a web browser. Everything is emulated through Javascript calls.

If you don't need that, or just need the WASI subset, you can simply use Zig to compile C/C++ code to WebAssembly ("zig cc -target wasm32-wasi"). Compilation is as fast as other targets.