3 ms·
I’ve been looking at Zig for some time, too. Perhaps I should give it a go! Any particular tricks on making bridged DOM fast?
by notpushkin 2y ago
I’ve been looking at Zig for some time, too. Perhaps I should give it a go!
Any particular tricks on making bridged DOM fast?
- qvq 2y agohttps://crates.io/crates/sledgehammer#:~:text=Why%20is%20it%20fast https://crates.io/crates/sledgehammer#:~:text=Why%20is%20it%...
- whitehexagon 2y agoI use a custom API on the JS side, and making the most of the shared memory for strings. For widget creation within DOM I have small API wrappers on the JS side to avoid too much bridge crossing with attribute sets/gets. For 2D/3D moving the canvas animation loop to the JS side helped. So far the html (inc custom JS API) comes in at 20KB, and my wasm around 80KB (SVG based UI with a small embedded font). Not sure how the latest Zig compares, but I'd be quite happy stuck on this older version for this project because it seems very stable.