# Koka v3.2.9: a functional language where effects live in the type

> Koka is a research language with effect types and handlers that compiles to C without a garbage collector. It is not ready for production, and the README says so itself.

**koka-lang/koka** — Koka language compiler and interpreter

- Repository: https://github.com/koka-lang/koka
- Website: http://koka-lang.org
- Stars: 4,074 · Forks: 224
- Language: Koka
- License: NOASSERTION
- Published: 2026-09-23 · Updated: 2026-09-23 · Language: en
- Canonical page: https://hysenlabs.com/projects/koka-lang-koka

## What Koka is for, and who should not use it

Koka is a strongly typed functional-style language whose distinguishing feature is that every function's type carries its side effects. The README describes the core as a small set of well-studied features: first-class functions, a polymorphic type and effect system, algebraic data types, and effect handlers. The intended audience is people who want to reason about effects statically, and who want to define control abstractions such as exceptions, async/await, or probabilistic programs as an ordinary user library rather than as compiler built-ins.

The README is blunt about status: Koka v3 is described as a research language that is currently under development and not quite ready for production use. That sentence should decide most adoption questions on its own. If you are shipping a service, a CLI that other teams depend on, or anything with an operational on-call rotation, this is the wrong tool. If you are writing a paper, teaching effect handlers, prototyping an interpreter, or exploring what a typed effect system feels like in practice, it is aimed at you.

## How effect types and handlers actually work in Koka

The mechanism is a type-and-effect system. A function's type records the effects it may perform, so pure and effectful computations are distinguished at the type level. The README argues this gives Koka semantics backed by category theory, which it claims makes programs easier to reason about for both humans and compilers. Whether you accept the second half, the first half is checkable: the effect row is part of the signature you write.

On top of that sits the handler. A handler is a user-defined construct that gives meaning to an effect: you declare an effect, then interpret it. Exceptions, async/await, and probabilistic programming are all listed in the README as things you can build this way, in a typed and composable fashion, without special compiler support.

The compilation story is the other half. Perceus is described as an advanced compilation method for reference counting, and together with evidence passing it lets Koka compile directly to C without a garbage collector or runtime system. Perceus also performs reuse analysis and optimizes functional-style programs to use in-place updates where it can. That is the architectural claim to check against generated C output: reference counting inserted by the compiler, no tracing collector behind it.

## Installing Koka and writing a first handler

The README points at binary installers for Windows (x64), macOS (x64 and M1), and Linux (x64). For anything else, you build the compiler from source. The source build needs Stack to run the Haskell compiler, and optionally vcpkg for linking C libraries, nodejs for the JavaScript backend, and emscripten plus wasmtime for the Wasm backend. On Windows the README recommends clang or the Visual Studio C compiler, and warns you to set the console codepage to UTF8 first.

If you build from source, clone recursively. The README notes that omitting --recursive produces errors when compiling Koka modules.

```bash
git clone --recursive https://github.com/koka-lang/koka
cd koka
stack update
stack build --fast
stack exec koka
```

The last command starts the compiler. If you cloned without --recursive, the README gives the fix:

```bash
git submodule update --init --recursive
```

For a first real program, the repository keeps worked examples under samples/, including samples/handlers/ and samples/learn/. Those directories are the practical starting point, because the README's tour of the language lives in the Koka book rather than in the repository text. Compile one of the sample files with the compiler you just built and read the generated output alongside it; that is where the effect typing and the Perceus reference counting become visible rather than theoretical.

## Where Koka breaks down

The largest limitation is stated by the project itself: not quite ready for production use. Treat that as a hard boundary rather than a disclaimer to negotiate around.

Platform coverage is narrower than the language's ambitions. The README lists binary installers for Windows x64, macOS x64 and M1, and Linux x64. The commented-out text in the README mentions arm64 and FreeBSD but leaves them out, so on those platforms you are building from source with Stack. A source build pulls in a Haskell toolchain, which is a heavier dependency than most people expect from a language that compiles to C.

The backend matrix is another source of friction. JavaScript output needs nodejs; Wasm output needs emscripten and wasmtime. Each backend is optional, which also means each is a separate thing to keep working.

Finally, there is no package ecosystem described in the repository's own documentation. The repository carries lib/ and kklib/ as its own library trees. If your project depends on finding a maintained third-party Koka library for a common task, nothing here suggests you will find one.

## Koka against Haskell, and what the difference buys you

The repository topics list haskell alongside algebraic-effects and effect-handlers, which is a fair pointer to the nearest comparison. Both are typed functional languages. The difference is where effects are handled.

Haskell pushes most effects into monads and monad transformer stacks, and the type of a computation records which monad it lives in. Koka puts an effect row directly in the function type and provides handlers as a general language construct, so exceptions, async, and probabilistic computation are library code rather than instances of a fixed type class hierarchy. The README's framing is that each core feature is as general as possible to avoid special extensions.

The compilation targets diverge too. Koka's stated design compiles to C through Perceus reference counting with no garbage collector or runtime system. That is a materially different deployment shape from a language that expects a managed runtime. If your reason for looking at Koka is the effect system, the handler model is the part to evaluate. If your reason is the C output, the reference counting scheme is the part to evaluate.

## Releases, licence and the cost of keeping up

The current release is v3.2.9, dated 2026-09-17 in the README and 2026-09-18 in the release list. The previous stable release was v3.2.3 in March 2026, with a v3.2.3-alpha1 before it in February 2026. The last push to the default branch, dev, was on 2026-09-18. So this is a project that moves: expect the language and its libraries to change between releases, and expect to re-read the release notes rather than assume your code still compiles.

The README points at the whatsnew notes under support/vscode/koka.language-koka/ for release changes. There is also a VS Code language integration, credited to Tim Whiting and Fredrik Wieczerkowski, which is the editor path the project itself highlights.

On licensing: the repository reports NOASSERTION, which means no standard SPDX identifier was detected for the licence. The LICENSE file sits at the top level of the repository. Read it yourself before you depend on the compiler or the libraries, and if the terms matter to your organisation, get them reviewed. Nothing in the repository resolves what the terms actually are.

## Conclusion

Koka is worth adopting for people who want to write and study effect handlers in a typed language: install a binary release, run the samples under samples/handlers/, and read the Koka book before committing code. It is not the tool for a production service, since the README calls it a research language that is not quite ready for production use, and it is not the tool for someone who wants a large third-party package set, since the repository ships its own lib/ and kklib/ trees rather than an ecosystem. Verify first that a binary installer exists for your platform, that your C toolchain works on the generated code, and which backend you need (C, JavaScript, or Wasm) before you plan anything around it.

## FAQ

### What is the Koka language?

Koka is a strongly typed functional-style language with effect types and handlers, described in its README as a research language under development and not quite ready for production use. Its compiler uses Perceus reference counting and evidence passing to compile directly to C without a garbage collector or runtime system.

### What does "koka" mean?

The README does not explain the origin or meaning of the name. The repository is koka-lang/koka and the project site is koka-lang.org, but no etymology is stated anywhere in the repository text.

### Which platforms can Koka be installed on?

The README lists binary installers for Windows (x64), macOS (x64 and M1), and Linux (x64). For other platforms the compiler must be built from source, which requires Stack and, depending on the backend, nodejs, emscripten, wasmtime or vcpkg.

### Does Koka need a garbage collector at runtime?

No. The README states that Perceus, its reference counting compilation method, together with evidence passing lets Koka compile directly to C code without needing a garbage collector or runtime system.

### Where are Koka examples and library documentation?

The repository has a samples/ directory with subdirectories such as samples/handlers/, samples/learn/, samples/basic/, and samples/async/. The README also points to the Koka book for a language tour and specification, and to separate library documentation.

### What licence does Koka use?

The repository reports NOASSERTION, meaning no standard licence identifier was detected. A LICENSE file is present at the top level of the repository, and the README does not state which licence it contains.

## Sources

- [Issues](https://github.com/koka-lang/koka/issues)
- [koka-lang/koka on GitHub](https://github.com/koka-lang/koka)
- [Project website](http://koka-lang.org)
- [README](https://github.com/koka-lang/koka/blob/dev/README.md)
- [Releases](https://github.com/koka-lang/koka/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/koka-lang-koka
