Wasm Application Binary Interfaces (ABIs)
Warning
SingleStore 9.0 gives you the opportunity to preview, evaluate, and provide feedback on new and upcoming features prior to their general availability. In the interim, SingleStore 8.9 is recommended for production workloads, which can later be upgraded to SingleStore 9.0.
On this page
When a Wasm function is created, you can specify one of the following Application Binary Interfaces (ABIs): Basic or Canonical.
-
Basic: This is the bare-bones Wasm ABI.
It supports only 32-bit and 64-bit integers and floating point numbers. -
Canonical: This ABI type is defined by the Canonical ABI specification (a part of the Interface Types proposal).
It is a superset of Basic ABI, and it allows usage of structured and complex interface types.
SingleStore supports both the Basic and Canonical Wasm Application Binary Interfaces (ABIs).
-
Using the Basic ABI, SingleStore supports any language that can compile to Wasm code, if the UDF accepts and returns only numeric data types.
-
Using the Canonical ABI, you can pass and return complex data types from UDF/TVF.
SingleStore currently supports the following languages for Canonical ABI: -
C/C++
-
Rust
-
Note
The user must ensure that the specified ABI type matches the Wasm module implementation.
Canonical ABI
The canonical ABI is a proposed part of WASI.
The wit-bindgen
tool, which generates bindings for the Canonical ABI, declares function and structure names as hyphenated strings.`
), Hence, all function, parameter, and record field names loaded from the Wasm modules are renamed to use underscores instead of hyphens.
user-function-name: func() -> string;
To call this Wasm UDF, we use the following syntax:
SELECT user_function_name();
Last modified: March 25, 2025