5 ms·
Mobile browsers do support wasm, but the game doesn't offer controls for mobile users who aren't using a keyboard. Taking 100.6 KB (16.46 KB compressed) of jav
by charcircuit 3y ago
Mobile browsers do support wasm, but the game doesn't offer controls for mobile users who aren't using a keyboard.
Taking 100.6 KB (16.46 KB compressed) of javascript and 37.41 MB (8.15 MB compressed) for snake is quite a lot compared to what it would take for normal javascript.
- lwansbrough 3y agoFor sure, but snake also doesn't need a game engine. I don't think the exercise was code golf.
- jarjoura 3y agoWASM is kind of coming full circle back around to when browsers used to support running Java Applets, or flash, or even ActiveX, however, this time, WASM is safe and is built into the browser. Figma has been the one platform to take full advantage of it in really jaw-dropping ways that proved you could write real creative professional productive software only in the frame of a Chrome window. It's just that WASM is not really practical for use for most things you want in a web browser, though the tooling to spit out WASM modules seem to keep getting better.
- mminer237 3y agoI mostly agree, but for most of its life, the Flash runtime was ~1MB and shared among every site. Every site needing to download a separate 38MB runtime is an insane amount of overhead.
- vacuity 3y agoCould the WASM runtime eventually be shared like that? Also, is there a reason why the overhead is so large compared to Flash?
- vacuity 3y agoWhat are more uses that WASM (or any theoretical technology, really) could have for a web browser? Do you mean scripting to customize the browser itself?
- lkt 3y agoBevy has a lot of features enabled by default that add to the size. You can get bevy-snake down to 12 MB (3.2 MB gzipped, 1.9 MB brotli'd) if you only enable rendering and sprites, and strip the function names section. It's still a little bigger than I would like, but it's not terrible.
- ofrzeta 3y agoIt's a really barebones snake game that should take less than 12 kb. Anyway I get that it's more of a proof of concept for Bevy.