docker build -t turmeric . && docker run --rm -it turmeric
Capabilities
Turmeric compiles to native code with whole-program optimization. Incremental builds are fast by design -- spend more time writing, less time waiting.
sub-second buildsAd-hoc polymorphism with zero-cost dispatch. Define interfaces, implement them for any type, and let the compiler verify everything.
Functor · Monad · FoldableModel side effects as first-class values. Compose, intercept, and resume them with handlers -- no monad transformers required.
defeffect · perform · handleExhaustive pattern matching on algebraic data types defined with defdata and generalized with defgadt. Every case is handled.
Delimited continuations with reset and shift let you encode coroutines, generators, and advanced control flow as ordinary library code.
A compile-time macro system with quasiquote and unquote. Extend the language with new syntax without sacrificing readability.
defmacro · quasiquoteTypeclasses
Attach new behavior to any type without touching it. Turmeric resolves typeclass dispatch at compile time -- no virtual tables, no runtime cost.
From typeclasses and HKTs to runtime contract types, Turmeric offers multiple forms of polymorphism. Choose what fits the problem -- not what the type system forces on you.
Effect Handlers
The same business logic powers your production app and your test suite. Swap the handler -- not the function. No mocking frameworks, no dependency injection.
Turmeric's algebraic effect system makes this possible: declare what a function can do, not how it does it. The type system ensures every effect is handled.
Package Manager
One build.tur declares your package and its dependencies. Reference any spice by Git URL -- no registry account, no separate tooling. Third-party spices import just like your own modules.
Most spices are pure Turmeric or inline C -- nothing to install. When you need a native C library, add it to :cmake-deps and Turmeric handles fetching, building, and linking automatically. Many popular libraries already have Turmeric spices -- like tur/raylib -- so you may not need it at all.
Get Started
Installs tur via Homebrew on macOS. On Linux, grab a prebuilt binary from the releases page, build from source, or use the Docker image.
Creates a project with sensible defaults, a package manifest, and a hello world entry point.
Return types are annotated with :int, :bool, or :cstr. The compiler catches type errors before you run.
The Spice registry hosts packages for GUI, audio, HTTP, JSON, databases, parsing, and more.
Try Turmeric in your browser -- no install required.