# Wasm Application Binary Interfaces (ABIs)

When a Wasm function is created, you can specify one of the following Application Binary Interfaces (ABIs): Basic or Canonical. The default ABI type is **Canonical**, unless specified explicitly.

* **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](https://github.com/WebAssembly/interface-types/blob/40f157ad429772c2b6a8b66ce7b4df01e83ae76d/proposals/interface-types/CanonicalABI.md) specification (a part of the [Interface Types](https://github.com/WebAssembly/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. A mismatch may lead to unexpected results at runtime.

## Canonical ABI

The canonical ABI is a proposed part of [WASI](https://github.com/WebAssembly/WASI). To use the canonical ABI, you must specify additional metadata in the form of a [WIT IDL](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) string.

The `wit-bindgen` tool, which generates bindings for the Canonical ABI, declares function and structure names as hyphenated strings. Using hyphenated names for UDFs/TVFs requires them to be enclosed in backticks (`` ` ``), Hence, all function, parameter, and record field names loaded from the Wasm modules are renamed to use underscores instead of hyphens. For example, consider the following Wasm UDF specified by the WIT definition:

```WIT
user-function-name: func() -> string; 
```

To call this Wasm UDF, we use the following syntax:

```sql
SELECT user_function_name();
```

***

Modified at: August 4, 2025

Source: [/db/v9.1/reference/code-engine-powered-by-wasm/wasm-application-binary-interfaces-abis/](https://docs.singlestore.com/db/v9.1/reference/code-engine-powered-by-wasm/wasm-application-binary-interfaces-abis/)

(An index of the documentation is available at /llms.txt)
