I'll write a blog post on the subject in a few weeks, which will probably end up here because Rust. The short version:
* This use case involves tons of string parsing and concatenating, which vanilla Rust does not make intuitive. A garbage-collected language would also probably handle this more efficiently than I can, given that Rust is doing exactly what I tell it and I don't have the time or inclination to microoptimize piles of parsing code.
* Generally, the work is sufficiently high-level to require large swaths of the standard library and a fair number of dependencies despite my best efforts.
* I've built a brick wall between myself and my data store. Ultimately persistence happens in IndexedDB with a JS shim, but currently the application loads the entire contents of your IndexedDB database into memory and runs based on that.
The WASM binary weighs in at 1.6 MB (500 kB over the wire). The source, without excluding tests, comes in at 580 kB (estimate 400 kB of actual code). If it were Typescript, I could probably minify that down to 200 kB or less, and that would still be plain text and achieve a better compression ratio than my WASM binary.
Mind you, I haven't put in a huge amount of work to stripping down the binary. But that's more or less the point: choosing Rust/WASM ended up having a lot of down sides without much in the way of up side, save for one: it's been a lot of fun to do, and I probably wouldn't have made it this far in a language I didn't enjoy as much.
* This use case involves tons of string parsing and concatenating, which vanilla Rust does not make intuitive. A garbage-collected language would also probably handle this more efficiently than I can, given that Rust is doing exactly what I tell it and I don't have the time or inclination to microoptimize piles of parsing code.
* Generally, the work is sufficiently high-level to require large swaths of the standard library and a fair number of dependencies despite my best efforts.
* I've built a brick wall between myself and my data store. Ultimately persistence happens in IndexedDB with a JS shim, but currently the application loads the entire contents of your IndexedDB database into memory and runs based on that.
The WASM binary weighs in at 1.6 MB (500 kB over the wire). The source, without excluding tests, comes in at 580 kB (estimate 400 kB of actual code). If it were Typescript, I could probably minify that down to 200 kB or less, and that would still be plain text and achieve a better compression ratio than my WASM binary.
Mind you, I haven't put in a huge amount of work to stripping down the binary. But that's more or less the point: choosing Rust/WASM ended up having a lot of down sides without much in the way of up side, save for one: it's been a lot of fun to do, and I probably wouldn't have made it this far in a language I didn't enjoy as much.