6 ms·
Go isn't a very good fit for this kind of thing. I've done it with Rust (Leptos, Dioxus, etc). The wasm binaries are a lot more sane when using Rust. On average
by bitbasher 2y ago
Go isn't a very good fit for this kind of thing. I've done it with Rust (Leptos, Dioxus, etc). The wasm binaries are a lot more sane when using Rust. On average, my wasm binary was around 240kb and it compresses really well over the wire.
- ucirello 2y agoWhy not Zig?
- xmprt 2y agoZig doesn't have a 1.0 release yet so I'd be hesitant to use it on any production projects. I've dabbled in it for some toy projects just to get a feel for the language and so far I think I still prefer Rust although the simplicity of Zig is something I can get behind.
- satvikpendem 2y agoWhy not Rust? Zig does not have nearly the same memory guarantees as Rust, I mean, why create a new language and still make the same fundamental errors when we've fixed them in other languages. That's also how I feel about Go and its lack of algebraic data types.
- kflgkans 2y agoZig is a completely different language than Rust. Memory safety is just one aspect. I personally find Rust to be very difficult to read and can never manage to be productive in it.
- satvikpendem 2y agoLacking memory safety is a fundamental mistake in my opinion, not merely one aspect. We have learned much from the days of C and C++, so much that companies are migrating away and finding that many of their bugs are solved with memory safe languages like Rust.
- kflgkans 2y agoI forgot to follow up on this, I don't know how to make HN give me some kind of a notification on replies to my comments. I should have been a bit more clear. I love memory safety. But I dislike a lot of other aspects specific to Rust. I would much prefer e.g. C with memory safety (somehow). So that is, for me, why not Rust. Rust is more more than just memory safety.
- satvikpendem 2y agohttps://www.hnreplies.com https://www.hnreplies.com is an unofficial way to get comment replies via email. Perhaps you should look into Vale or Pony then, they have memory safety like Rust, also without a GC, but they use different mechanisms for it.
- mmarian 2y ago> I don't know how to make HN give me some kind of a notification on replies to my comments I built https://hackernewsalerts.com https://hackernewsalerts.com for that
- Philpax 2y agoWhat does Zig offer over Rust in this use case? It makes lower-level operations easier, but that's not super relevant to most UI work (unless you're Figma)
- potamic 2y agoWhat about Go causes large binaries?
- tazjin 2y agoWell, for one, you need the whole Go runtime.
- iforgot22 2y agoCan that at least be a separate wasm file from some common URL so the browser can cache it?
- ahoka 2y agoBrowsers don’t do that. Caches are not shared across sites.
- iforgot22 2y agoDidn't expect that, but not very surprised. So short of the browser giving the Go runtime some special treatment, this sounds like a no-go.
- spiffytech 2y agoNit: they don't do that anymore, because cross-origin caches cause privacy problems. But they used to, and this news is still percolating through the industry.
- iforgot22 2y agoSome of them still do, if someone is using an outdated enough browser :D for example Chrome <86 (released 2020).
- Muromec 2y agoYou can't have dymanic linking of two C-like libraries compiled to wasm, because you would not be able to pass pointers around. Basically everything you compile to wasm becomes static binary which needs some bitfiddling to interact with.