User-defined functions (UDFs) are common feature of most SQL databases, if the task you want to undertake is a challenge with SQL, you can write functions using mainstream programming languages. These are then deployed to the database, which hosts and executes them.
WebAssembly is an ideal runtime for UDFs, it has a strong security model through sandboxing, and supports a wide range of programming languages. This post explores creating Wasm powered UDFs for the open source TiDB database.
Talking of WebAssembly as a plugin host, I spotted that Microsoft’s Flight Simulator has a WebAssembly-based plugin system. Neat!
PLOP (I love the name) is a falling sand game, a particle simulation where you have a whole host of different materials at your disposal. I could waste hours playing with this!
The game is written in C, compiled to WebAssembly, with the sourcode available on GitHub.
Rust, together with WebAssembly, is an even more potent combination. The portability of the WebAssembly runtime means that you don’t have to build tools for specific architectures. Furthermore, the security model of WebAssembly should help address the growing problems of software supply chain attacks.
WebAssembly is a great way to bring C / C++ applications to the web. It just so happens that Emscripten, the C++ to WebAssembly compiler, is a command line application written in C++, so why not bring that to the web too? Emception uses Emscripten to bring Emscripten itself to the web. 🤯
Kotlin is a new language, developed by JetBrains, which has growing support, especially among the Java community. They have recently announced WebAssembly support. This video gives a first look.