It is really cool to learn WASM by recreating existing web experiences in a different language and compiling. This is a great tutorial for that!
Is this a good idea for WASM in general though? The web_sys crate looks useful, but are you just jumping back and forth across the JavaScript/WASM boundary in order to achieve this, negating any performance benefits of WASM itself?
That is an awesome question.Boundary crossing is an important factor for any WASM app.
Performance wise it will be slightly slower every crossing here adds few nano seconds overhead. but browsers like Firefox is optimised well enough. You will have a problem only when you transfer huge chunk of data.
General advise will be use WASM where you need to have computation heavy operation and minimize boundary crossing
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It is really cool to learn WASM by recreating existing web experiences in a different language and compiling. This is a great tutorial for that!
Is this a good idea for WASM in general though? The web_sys crate looks useful, but are you just jumping back and forth across the JavaScript/WASM boundary in order to achieve this, negating any performance benefits of WASM itself?
That is an awesome question.Boundary crossing is an important factor for any WASM app.
Performance wise it will be slightly slower every crossing here adds few nano seconds overhead. but browsers like Firefox is optimised well enough. You will have a problem only when you transfer huge chunk of data.
General advise will be use WASM where you need to have computation heavy operation and minimize boundary crossing