Skip to main content

Wasi Emscripten Host

This Kotlin Multiplatform library provides an experimental implementation of WebAssembly host functions from the Emscripten JS environment, and some functions defined in the WASI Preview 1 specification.
It is designed to work with JVM/Multiplatform WebAssembly runtimes such as GraalVM, Chicory, and Chasm.

The primary goal is to run WebAssembly binaries compiled with Emscripten in a JVM environment, without the need for a browser or JavaScript.

Currently, the library implements a limited subset of host functions needed to run a single-threaded version of SQLite compiled with Emscripten. It may also work in other cases. The WASI/Emscripten filesystem is partially implemented.

Usage

Refer to the sections on integration with runtimes:

Releases

The latest release is available on Maven Central.

repositories {
mavenCentral()
}

Snapshot versions may be published to an own repository:

pluginManagement {
repositories {
maven {
url = uri("https://maven.pixnews.ru")
mavenContent {
includeGroup("at.released.weh")
}
}
}
}

Status and Future Plans

The project is likely to be frozen. However, if there is interest or demand, we may implement the full set of WASI functions.

Here are some related projects:

  • wasm-sqlite-driver-binary SQLite binaries, the primary target for this library.
  • wasm-sqlite-open-helper Implementation of SQLiteDriver and SupportSQLiteOpenHelper.Factory based on SQLite compiled for Wasm. This is a project where this library is used.