Technical details
This page summarizes some of the technical details for people familiar with the WASM ecosystem.
Runtime
Golem uses a forked version of Wasmtime v17.0 (opens in a new tab). The fork contains minimal changes to the original required for implementing the durability properties of Golem. The forked repository is available on GitHub (opens in a new tab).
WASI
Golem provides the following host interfaces:
- The final WASI Preview2 (opens in a new tab)
- WASI Logging (opens in a new tab)
- WASI Blobstore (opens in a new tab)
- A subset of WASI KeyValue (opens in a new tab)
The WASI TCP and UDP interfaces are currently not supporting persistent execution but they are
added to the linker to avoid linker errors for example with componentize-py
outputs.
Component model, tiers, commands, reactors
Golem is built on the WebAssembly Component Model (opens in a new tab) from scratch. The components for Golem workers are WASM components, and the exported component model functions and instances are directly exposed via Golem's worker API for invocation.
As explained on the building components page, Golem uses the concept of tiers to categorize support for various guest languages.
The tiers are:
- Tier 1 languages are having a WIT binding generator or directly support the component model and thus can be used to implement "reactor" (or "library") components, with multiple exported functions, and they can import and use any of the supported host interfaces.
- Tier 2 languages have no binding generators, but they can be used with the preview1 adapter to implement "command" components, exposing a single parameterless
run
function. There are Golem features allowing some level of interactivity with these components via standard input and output. - Tier 3 languages are everything else
Repositories
We have the following open-source repositories:
- Golem (opens in a new tab) is the primary repository containing all the open-sourced Golem services.
- Golem WIT (opens in a new tab) holds all the WIT definitions of the provided WASI interfaces, as well as the matching preview1 adapter modules.
- Golem Examples (opens in a new tab) is a repository of example components, exposed by the
golem new ...
command. - Golem WASM AST (opens in a new tab) is a higher level library on top of
wasmparser
andwasm-encoder
used by Golem to analyse the uploaded components. - docs (opens in a new tab) holds these documentation pages.
- Wasmtime (opens in a new tab) is the forked version of Wasmtime used by Golem.
- reqwest (opens in a new tab) is a fork of the Rust
reqwest
library, providing a WASI-Http based HTTP client. - go-wasi-http (opens in a new tab) is a Go package implementing the http.RoundTripper (opens in a new tab) interface, allowing Go programs to use the built-in http client through WASI Http.
- golem-rust (opens in a new tab) is an experimental set of Rust macros reducing the boilerplate of WIT bindings and providing a higher level API for Golem specific host functions.
- golem-openapi-client-generator (opens in a new tab) is a code generator that transforms GOlem's OpenAPI specs into a Rust client library.
- golem-scalajs-wit-bindgen (opens in a new tab) is a binding generator from WIT for Scala.js