Integrating Native Code with WebAssembly
The whole point of actually using Node.js is convenience. Node.js never aspired to be the fastest runtime, the most complete one, or the most secure one. However, Node.js established a quick and powerful ecosystem that was capable of developing a set of tools and utilities to actually empower the web development standards that we are all used to today.
With the growth of Node.js, the demand for more specialized systems also increased. The rise of new runtimes that offered alternatives to Node.js actually resulted from this need. An interesting alternative can be found in the WebAssembly language. WebAssembly is a portable binary-code format like the Java Virtual Machine (JVM) or the Microsoft Intermediate Language (MSIL). This makes it a potential compilation offering for any language – especially lower-level languages such as C or Rust.
In this chapter, you’ll learn what WebAssembly has to offer, how you can integrate existing...