WebAssembly is production-ready. Although only in version 1.1, the bytecode is already in use. Not only by hobby programmers but also by large companies and projects.

Here are 3 projects & companies that use WebAssembly in different ways. Have fun!

1. Figma

Figma is a cloud-based design tool that runs entirely in the browser. With SVGs and canvas in the browser, you don’t get far. For blurring, gradients, and blending to work properly on the design platform, it relies entirely on its own WebGL engine.

Figma has been using Emscripten, a WebAssembly compiler for C and C++, for years. But since WebAssembly was only released in 2017, Figma worked with asm.js until then. Emscripten then compiled the C/C++ code to asm.js.

asm.js is a JavaScript subset. Instead of strings and objects, there are only numbers. This allows the execution of C++ code because everything is represented with numbers under the hood. The entire C++ memory-space can be represented in asm.js with a huge array of numbers. Pointers then work as indexes to the array.

One advantage is that 32-bit floats can be used instead of JavaScript’s 64-bit doubles. In large applications, this has a positive effect on memory usage.

Yes, this is all quite complicated and abstract. The important thing is that you understand that Figma has done a lot of optimization before WebAssembly.

So the performance comparison is not to “classic” JavaScript.

#nodejs #webassembly #javascript

3 Big Projects That Are Already Embracing WebAssembly
25.80 GEEK