Now that @rustwasm published web-sys, I just published my first crate it's literally the Wurst. https://github.com/jonathanKingston/wurst …
It's the start of exposing a simple abstraction around web-sys that's a little closer to jQuery whilst trying to be idiomatic @rustlang.
-
Show this thread
-
What's the size of the wasm binary please? AFAIK rust do have dead code elimination but still these abstractions must have a cost. Is that anything near current popular js libs?
1 reply 0 retweets 0 likes -
The super minimal example: https://github.com/jonathanKingston/wurst/blob/master/examples/form-example/src/lib.rs … compiles to 350kb with 19kb of JS. I haven't done any work for making this smaller though.
1 reply 0 retweets 1 like -
Replying to @KingstonTime @IcanDivideBy0 and
So it's not super ideal at the moment but because it's wasm it doesn't really grow in filesize after this in comparison to the same code in JS.
1 reply 0 retweets 0 likes -
Thanks! Indeed that still feels a lot. I've just learned about the wasm host binding proposal tho, this may drastically reduce the bin size. Anyways l love the direction
#rustlang + wasm is taking. Thank you for exploring possibilities :)1 reply 0 retweets 0 likes -
Yeah that will make a huge difference and web-sys is designed with that in mind, so that it will be many times smaller. Using a release build I managed to get it to 162kb which a lot more manageable. I'm also hoping to remove bindings I don't need too.
1 reply 0 retweets 0 likes -
Yeah release builds reduce bin size a lot! That's a very acceptable size IMHO considering the "real life" web do not fear to load 300kb for a simple ad x')
1 reply 0 retweets 1 like -
The two examples on https://rustwasm.github.io/2018/09/26/announcing-web-sys.html … are even smaller at 152 and 113kb. Both of those would likely be much bigger in JS. I'm likely doing something dumb to bloat the code. Wasm bindgen can produce files as low as 720bytes... so it's likely possible to improve here a lot.
1 reply 0 retweets 0 likes -
Plain JS will benefit a lot from gzip tho, I don't think wasm will at the same level. Pretty sure we can achieve the same in js with smaller bandwidth
2 replies 0 retweets 0 likes
-
-
I still didn't finished reading the book yet x) This link will come handy, thanks
1 reply 0 retweets 0 likes -
60kb and brotli down to 20kb. Haven't even even started any decent code size removal. I reckon it could be halved again.
0 replies 0 retweets 2 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.