3 ms·
Check out these samples: https://floooh.github.io/sokol-html5/ https://floooh.github.io/sokol-html5/, the wasm blobs there are between 8 KByte (for the clear sa
by flohofwoe 9y ago
Check out these samples: https://floooh.github.io/sokol-html5/ https://floooh.github.io/sokol-html5/, the wasm blobs there are between 8 KByte (for the clear sample) and 210 KByte (for the ImGui sample), all compressed size as downloaded by the brower. Most of the samples are done in C, the ImGui sample is C++. You have to pick the right C++ subset ("Modern C++" is pretty much what not to do if you care about binary size, instead use the C++ subset that's common in the embedded world). It's much easier to write slim code in C since this is a much simpler language and it's not so easy to hide a lot of crap under 'abstractions'. Of course if the C++ codebase is already bloated that's impossible to get small for WebAssembly.
Common sense is still required (which is unfortunately very rare in the modern programming world).