Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm actually in the process of writing a demoscene 64k in Rust+WASM, that will be contained in a single index.html.

Actually not sure if I'll get around to finishing it, but currently a WebGPU-based renderer + scene graph + softsynth fits in about 30k compressed. That's unfortunately a bit big, but we'll see.

If I don't get around to finishing it I'll probably open source the code anyway, just as a fun starting point for others maybe.



Would be good to see the process and sound.

Do you think it’s the WebGPU, scene graph, the sound, or the Rust infrastructure that consumes the most space?


A little bit of everything, but the WebGPU stuff requires a full interop layer to translate WebGPU calls on the Rust side into calls on the JS side (a poor man's wasm-bindgen basically).

Additionally, there's just a lot of code being generated for common containers. It would probably be simpler and smaller to create unsafe containers that just shift pointers to boxed structs around or something, but I haven't gotten around to that yet.


Ah I see. That sounds lots of boilerplate. Wonder whether WebGL uses less space.


You'd still need the same kind of interop layer. The question then becomes if there are more or fewer classes and methods you'd need to wrap on the Rust side.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: