top | item 45855298

(no title)

kubafu | 3 months ago

Big fan of htmx here, so thanks for opening my eyes to a new way of using it with service workers.

But man, 10MB Go WASM download? That's a no go. It's not only about downloading it but executing on a clients machine over and over again. But I guess you can handle those requests perfectly fine just in service worker using pure JavaScript.

discuss

order

wffurr|3 months ago

Go and even TinyGo aren't a great fit for Wa because they have to bring along their own runtime including a GC. Go can't use WasmGC because it lacks support for interior pointers and unboxed heap primitives: https://github.com/WebAssembly/gc/issues/59

So you'll never get Go Wasm binary sizes down to something reasonable, alas.

andai|3 months ago

I did a bunch of game jams in various wasm langauges last year and what I got out of the experience was that you can do anything if you set your mind to it, but unless you have a good reason to use WASM (e.g. the performance?) you're generally going to be adding headache (build tooling, wrangling data between languages and runtimes, etc.) rather than removing it.[0]

(Some languages in particular are remarkably inflexible regarding how they want you to use them in this context.)

So seeing no real benefit. I ended up switching back to TS. I became depressed shortly afterwards, but that's probably unrelated ;)

Still, wasm game dev was a delightful experience in many respects and I would recommend it to anyone who's interested. ("Elimination of headache" is not necessarily an unambiguous good. Some headaches are genuinely worth it! Just depends on your taste and your goals.)

[0] My "favorite" bug was spending the last day of a game jam stuck on a bizarre compiler bug that would only manifest in the wasm version of the game... but I got it figured out in the end!

andai|3 months ago

For comparison, opened a random NY Times article. It downloaded 19MB before the page loaded, and then tried to show me an ad (it failed to load, for some reason), and then refused to actually show me the article.

I know it's "whataboutism" but I thought it was pretty funny.

euroderf|3 months ago

Oh and it does this even when you have a subscription.

phplovesong|3 months ago

IIRC wasm will get a GC soon, so i assume the tinygo project can produce way smaller binaries for wasm.