📖 Did you ever want to learn how to compile programming languages to #WebAssembly? If so, my new guide is for you.

Compiling to and optimizing #Wasm with #Binaryen:

👉 https://web.dev/articles/binaryen 👈

At the worked example of a synthetic toy language called ExampleScript, read how to compile it to WebAssembly and how to optimize the output!

Compiling to and optimizing Wasm with Binaryen  |  Articles  |  web.dev

Using the example of a synthetic toy language called ExampleScript, learn how to write and optimize WebAssembly modules in JavaScript using the Binaryen.js API.

web.dev
@tomayac Nice! Have you looked at #wizer? That's another intriguing optimisation step for #WebAssembly / #WASM: https://github.com/bytecodealliance/wizer
GitHub - bytecodealliance/wizer: The WebAssembly Pre-Initializer

The WebAssembly Pre-Initializer. Contribute to bytecodealliance/wizer development by creating an account on GitHub.

GitHub
@voxpelli Very interesting, I hadn't seen this before. This sounds more like a YMMV kind of optimization as per their README, but I'll check it out. Thank you!
@tomayac Yeah, eg Fastify uses it with their WASM-compiled SpiderMonkey on their Compute@Edge – they load the JS into SpiderMonkey then tells Wizer to take a snapshot of it once loaded and that then becomes the WASM that gets uploaded to their workers
@voxpelli @tomayac #jco uses it to crunch down size and startup time. We use it in our services as well.