News for hackers. Stuff that matters.
Re:How I went about learning Rust by azeirah on Friday July 15, 2022 @01:55AM (#32105028)
Just thinking out loud, does go compile to WASM? I often see performance critical WASM snippets written in rust, but never in Go.
Re:How I went about learning Rust by Philip-J-Fry on Friday July 15, 2022 @02:01AM (#32105073)
Go compiles to WASM but the stock compiler is pretty bad for this and your binaries are like 2MB+ in size.

TinyGo is an LLVM based compiler that targets microcontrollers but also has a WASM target and that creates considerably smaller binaries, but it doesn't fully support all of the Go standard library.

Re:How I went about learning Rust by doctor_eval on Friday July 15, 2022 @03:38AM (#32105708)
TinyGo is great, I used to to program microcontrollers and there wasn’t anything I really missed, though admittedly it was a very small program.
Re:How I went about learning Rust by rob74 on Friday July 15, 2022 @02:01AM (#32105069)
Yes it does, but there are some issues, mainly the size of the compiled WASM file. But you can get around that by using TinyGo. I'm not that deep into it, but this article seems to give a good (and as far as I can see up to date) overview: https://elewis.dev/are-we-wasm-yet-part-1
Re:How I went about learning Rust by masklinn on Friday July 15, 2022 @02:03AM (#32105080)
Go does compile to wasm, however because wasm is what it is it has to carry around the entire runtime. This is obviously a much bigger issue for delivery over the web than it is for shuffling binaries around, or even more so creating them locally: last I’d checked, the baseline (an empty main function) for a go wasm package is about 1.3M.
Re:How I went about learning Rust by pjmlp on Friday July 15, 2022 @02:04AM (#32105084)
Hardly an issue when looking at the ads crap that get download in every "modern" site.
Re:How I went about learning Rust by alpaca128 on Friday July 15, 2022 @02:31AM (#32105248)
Sure, but I think if you see the size of ad-loaded pages as a size budget or standard for your website you're already on the path towards setting your own bad example.
Re:How I went about learning Rust by masklinn on Friday July 15, 2022 @02:18AM (#32105175)
Sure if your use case for go wasm is ads crap knock yourself out.
Re:How I went about learning Rust by pjmlp on Friday July 15, 2022 @02:20AM (#32105190)
That wasn't my point, ads and SPA crap available almost in every "modern" site, are several MB bigger in size than Go runtime on WASM.

Ergo a a WASM Go application will be much smaller than those "modern" sites.

I bet even smaller than GMail and Google Docs.

Re:How I went about learning Rust by prerok on Friday July 15, 2022 @02:04AM (#32105085)
Sure it can: https://golangbot.com/webassembly-using-go/

Never tried it, though :)