Remix.run Logo
▲ KingOfCoders 2 hours ago

I'm using it to generate WASM, sadly Go with the GC/goroutine infra is not as good a WASM language than e.g. Rust which is a very simple 'binary', TinyGo works well though.

▲logicallee 2 hours ago | parent [-]

Could I ask how you do that? How do you actually build with a webassembly target? I might be interested.

▲wffurr 9 minutes ago | parent | next [-]

From the TinyGo docs, it’s as simple as

    GOOS=js GOARCH=wasm tinygo build -o wasm.wasm ./main.go
https://tinygo.org/docs/guides/webassembly/wasm/

It relies on LLVM’s Wasm backend and some JS glue libraries for the browser.

▲KingOfCoders 2 hours ago | parent | prev | next [-]

<Shameless plug> https://appfuzz.dev/ https://appos.build/

▲logicallee an hour ago | parent [-]

that's really interesting, thank you. I'm not sure we're ready to use that platform, though :)

▲KingOfCoders 29 minutes ago | parent [-]

Many aren't, it's a big ask. But I'm more interested in spreading the idea than selling something. I found WASM an underrated gem - e.g. https://pglite.dev/

▲01HNNWZ0MV43FF an hour ago | parent | prev [-]

So you want to take arbitrary code in arbitrary languages, and run it on someone else's computer inside a sandbox?

Yes, wasm can do that.

You can compile the code to wasm, then run it in a runtime like wasmer or wasmtime. Or you can ahead-of-time compile it with something like wasm2c, which generates C code.