Description #
Koka is a strongly typed functional programming language designed to make side effects explicit using algebraic effect types. It aims to bring clarity and safety to real-world programming.
History #
Koka was created by Daan Leijen at Microsoft Research. Its development began in the early 2010s as an experimental project exploring how algebraic effects could manage side effects in a composable and predictable way. Koka has evolved into a practical tool for academic and production-level code, with a focus on simplifying reasoning about side effects.
Hello World Code #
module hello
fun main() {
println("Hello, World!")
}
How to Run #
Option 1: Online
Koka Playground
Option 2: Local
- Install via GitHub:
git clone https://github.com/koka-lang/koka.git
cd koka
make
Run your program:
koka hello.kk
Key Concepts #
- Haskell-style syntax
- Strong static typing with type inference
- Algebraic effects and handlers
- Explicit side-effect tracking
- Functional-first design
- Modules and namespacing
- Pattern matching and recursion
- Built-in support for concurrency
- Research-oriented but growing in adoption
- Command-line REPL and native code backend
Try It Online #
https://koka-lang.github.io/koka/doc/index.html#playground
Fun Facts #
- Koka’s name is derived from the Japanese word for “effect.”
- It’s one of the few languages with row-polymorphic effect typing, enabling precise tracking of side effects.
- Koka was an influence on effect systems in languages like Eff, Multicore OCaml, and Flix.