5 From machine learning to databases: applications of Wasm
This chapter covers
- WASI as a collection of standardized interfaces
- Machine learning inference in Wasm
- Applying the ONNX format
- Running Wasm within databases
Up until now, we have undertaken much of the heavy lifting ourselves. We began the book without even using Wasm components, implementing our own lifting and lowering for the String type. Even after transitioning to Wasm components, we continued to create our own interfaces and hosts to serve as the backbone of our applications. This approach is not ideal for server-side development with Wasm. Instead, we should leverage out-of-the-box hosts and pre-written interfaces—unless, of course, we are developing a very specific application.
In this chapter, we will start utilizing standardized interfaces. Specifically, we will explore how to use the wasi:nn (for neural networks) interface to perform machine learning (ML) with Wasm and we will discuss a separate use case for Wasm running inside a database to power user-defined functions.