News for hackers. Stuff that matters.
Re:Build your own WebAssembly Compiler (2019) by kouteiheika on Sunday December 03, 2023 @05:09PM (#38511230)
> A lot of optimizations can be baked into the generated wasm, but you still need to spend some time doing eg register allocation.

Such a shame WASM is a stack machine. If it wasn't we could have had fast, singlepass compilation with near native performance without any complex optimizing recompilers or multi level JITs.

(This is not speculation. I actually wrote a VM which executes code as fast as wasmtime but compiles 160 times faster and guarantees O(n) compilation.)

Re:Build your own WebAssembly Compiler (2019) by disintegore on Monday December 04, 2023 @08:59AM (#38517265)
Interesting. Would the differences in binary sizes be prohibitive for use on the internet?
Re:Build your own WebAssembly Compiler (2019) by kouteiheika on Monday December 04, 2023 @10:30AM (#38518449)
> Would the differences in binary sizes be prohibitive for use on the internet?

No. They are competitive. For one of my benchmarks I get a WASM blob that is 90KB, and for my VM I get 76KB. (Both are stripped of any debug info.)