Key Value API
1
4fbf02fc-0329-4291-aac3-0143969167c4
Promise API
2
4fbf02fc-0329-4291-aac3-0143969167c4
Worker API
8
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Token API
7
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Template API
6
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Project policy API
5
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Project grant API
4
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Project API
3
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Login API
2
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Account API
1
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Breaking changes August 2023
1
726cfb0b-bffe-41ba-98b4-94069569ec3c
Overview
0
726cfb0b-bffe-41ba-98b4-94069569ec3c
Tier 4 languages
4
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
Python
4
54bda586-0bf3-430e-93e5-6d8c578372bd
Overview
0
ac8f610e-7e8f-465d-9e32-4b6ae0aba3b5
Overview
0
0f58ad57-8cb7-4a64-8aed-c7bea90c37f9
Overview
0
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
Overview
0
54bda586-0bf3-430e-93e5-6d8c578372bd
Overview
0
9b92ca64-009f-47e8-9457-b544f786d8af
Quickstart
2
1d167981-dd90-40ab-8023-3b2013ceb5c5
Overview
0
1aa11fd4-1dcf-4c87-8b46-5c15ca815d61
Overview
0
4fbf02fc-0329-4291-aac3-0143969167c4
Overview
0
d0be080a-56f4-481a-91d3-ba7d30c144f4
Common tooling
1
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
C
3
54bda586-0bf3-430e-93e5-6d8c578372bd
Go
2
54bda586-0bf3-430e-93e5-6d8c578372bd
Grain
3
9b92ca64-009f-47e8-9457-b544f786d8af
Swift
1
9b92ca64-009f-47e8-9457-b544f786d8af
C#
3
9b92ca64-009f-47e8-9457-b544f786d8af
Zig
2
9b92ca64-009f-47e8-9457-b544f786d8af
Rust
1
54bda586-0bf3-430e-93e5-6d8c578372bd
Overview
0
fc0b5887-cca5-4261-b6b7-73711f6f23b0
Overview
0
62133a19-c114-4a29-a74b-f986d118e157
Why Golem?
1
1d167981-dd90-40ab-8023-3b2013ceb5c5
Overview
0
1d167981-dd90-40ab-8023-3b2013ceb5c5
API Gateway
308adf1f-525e-460e-81c9-6ea00d1dbca4
d0be080a-56f4-481a-91d3-ba7d30c144f4
4
Release notes
726cfb0b-bffe-41ba-98b4-94069569ec3c
d0be080a-56f4-481a-91d3-ba7d30c144f4
9
Component interface
ac8f610e-7e8f-465d-9e32-4b6ae0aba3b5
d0be080a-56f4-481a-91d3-ba7d30c144f4
7
Getting Started
1d167981-dd90-40ab-8023-3b2013ceb5c5
d0be080a-56f4-481a-91d3-ba7d30c144f4
1
Building Components
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
d0be080a-56f4-481a-91d3-ba7d30c144f4
2
Tier 2 languages
54bda586-0bf3-430e-93e5-6d8c578372bd
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
2
Promises
62133a19-c114-4a29-a74b-f986d118e157
d0be080a-56f4-481a-91d3-ba7d30c144f4
3
Tier 3 languages
9b92ca64-009f-47e8-9457-b544f786d8af
03501aa5-572b-4129-aa0a-9e9fe9f5d3fc
3
Golem CLI
1aa11fd4-1dcf-4c87-8b46-5c15ca815d61
d0be080a-56f4-481a-91d3-ba7d30c144f4
4
REST API
fc0b5887-cca5-4261-b6b7-73711f6f23b0
d0be080a-56f4-481a-91d3-ba7d30c144f4
5
Runtime API
4fbf02fc-0329-4291-aac3-0143969167c4
d0be080a-56f4-481a-91d3-ba7d30c144f4
6
FAQ
0f58ad57-8cb7-4a64-8aed-c7bea90c37f9
d0be080a-56f4-481a-91d3-ba7d30c144f4
7

Overview

03501aa5-572b-4129-aa0a-9e9fe9f5d3fc

This page describes the latest recommended way of how to build Golem Templates that are fully compatible with Golem Cloud.

💡
Golem is using the WASM component model and provides access to the outside world through WASI Preview2.

As both the component model and preview2 are work in progress, it is important to the exact version of tooling and interface definitions which are compatible with the actual version of Golem Cloud, described in this document.

Writing Templates

Any programming language that can be compiled to WASM can be used to create Golem templates. It is not necessary to have WASM component model support ready as there are external tools to convert a WASM module into a WASM component.

In order to work with standard IO, file and filesystems, random number generation, HTTP calls, etc. the chosen programming language must have library support built on WASI - it can be WASI Preview1 (all the current implementations are targeting that), as there are external tools to wrap a WASM module using WASI Preview1 as a WASM component targeting WASI Preview2.

To use the new features of WASI Preview2 (such as sending HTTP requests) you have to explicitly depend on the WASI interfaces and write low-level code or wait until libraries get released targeting the new version.

Guest Language Support

Based on their support of WASI and the Component Model we categorize Guest Languages of Golem into 4 tiers:

Tier 1 Languages

Tier 1 languages have native support for building WASM components, working with WIT interfaces and their libraries are built on top of the latest version of WASI Preview 2.

We don’t have any language in this category yet, but we expect languages from the lower tiers to graduate here soon.

Tier 1 languages can fully take advantage of Golem.

Tier 2 Languages

Tier 2 languages can be compiled to WASM modules, their standard library is built on WASI Preview 1 and there is a WIT binding generator available for them.

Using the binding generator Tier 2 languages can take full advantage of Golem’s features:

  • They can define their own typed interface that can be invoked via Golem
  • They can use additional host interfaces such as WASI-HTTP and the Golem Promise API

This makes Tier 2 languages applicable in both actor-like and workflow-like use cases.

The currently supported Tier 2 languages are:

💡
Zig may be lifted to be a Tier 2 guest language in the near future, as it is supposed to work with bindings generated for C.

JVM languages like Java, Scala, Kotlin and Clojure could in theory be Tier 2 guest languages by using the experimental https://github.com/fermyon/teavm-wasi but it is not working currently.

Tier 3 Languages

Tier 3 languages can be compiled to WASM modules and they support WASI Preview 1 but there is no way to generate bindings for WIT interfaces.

This restricts them to only expose a single, parameterless run function and they can only access the host functionalities part of WASI Preview 1. (standard IO, files and filesystems, clock, random, cmd args / environment variables).

It is possible to pass input to these functions using the standard input and to get back their standard output as the call’s results, but this function can only be called once for each worker.

Golem provides two special calling conventions for workers implemented with a tier 3 language:

  • The stdio calling convention passes the invocation’s parameters through the worker’s standard input, and parses it’s standard output as JSON, returning as the invocation’s result. A worker after an stdio invocation is no longer usable.
  • The stdio-eventloop calling convention makes it possible to implement stateful workers with a tier 3 language but it requires the worker to be implemented as a loop that in each iteration reads a single line containing the invocation parameters as JSON, and before reading the next line is responsible to write the response to the standard output as a single-line JSON.

The currently supported Tier 3 languages are:

💡
Possible other supported Tier 3 languages added in the near future are Ruby, PHP and Haskell.

Tier 4 Languages

Tier 4 languages can be compiled to WASM modules but they don’t (or don’t fully) support even WASI Preview 1. In case they partially support WASI, they may still be used to implement stateless single-invocation workers which could be useful as parts of a bigger Golem application to expose some platform-specific functionality or third party libraries, for example.

The currently supported Tier 4 languages are:

  • C# - does not support reading from the standard input, so the stdio and stdio-eventloop calling conventions cannot be used. Parameters can be passed via environment variables and output can be written to the standard output.

Writing and Building Templates

Please refer to the chosen guest language’s subpage for more information about what tools to install and how to build Golem templates.

Subpages