Dependent Types. SMT Verification. Native FSMs. On the BEAM.
A strongly-typed, dependently-typed programming language that brings mathematical correctness guarantees to the battle-tested BEAM virtual machine. Build systems where verification matters more than convenience.
What makes Cure unique in the BEAM ecosystem
Express and verify invariants at compile time with length-indexed vectors, refinement types, and SMT-backed constraint solving.
State machines as native syntax with arrow-based transitions. The compiler verifies reachability, deadlock freedom, and invariant preservation.
Z3 and CVC5 solver integration validates your types and state machines. Your types are theorems, proven before execution.
No if-then-else. Pattern matching with guards ensures every case is handled. The compiler proves completeness.
Monomorphization, specialization, and inlining provide 25-60% performance improvements over baseline.
Compiles to BEAM bytecode with full OTP compatibility. Interoperate with Erlang and Elixir ecosystems seamlessly.
Complete Language Server Protocol implementation with real-time diagnostics, hover info, and IDE integration.
12 working modules including core, io, list, fsm, result, vector, string, math, and more with verified runtime execution.
A principled language that focuses on what's missing, not what's already there
Express and verify invariants at compile time. Vector operations that can't fail. Array access that's proven safe.
State machines aren't a pattern—they're native syntax with compile-time safety verification by SMT solvers.
Forces you to think in pattern matching and exhaustive cases. No forgotten edge cases. Every decision point is explicit.
When correctness matters more than convenience. For safety-critical systems, financial transactions, industrial control.
OTP fault tolerance, hot code reloading, distributed computing, and full Erlang/Elixir ecosystem access.
Complete compiler pipeline, comprehensive testing, working standard library, and LSP support for modern development.
# The type system proves this is safe—no runtime checks needed
def safe_head(v: Vector(T, n)): T when n > 0 =
head(v)
# FSMs with native syntax and compile-time verification
fsm TrafficLight do
Red --> |timer| Green
Green --> |timer| Yellow
Yellow --> |timer| Red
Green --> |emergency| Red
end
# Exhaustive pattern matching—compiler proves all cases handled
def classify(x: Int): Atom =
match x do
n when n < 0 -> :negative
0 -> :zero
n when n > 0 -> :positive
end
# Build the compiler
make all
# Try an example
./cure examples/06_fsm_traffic_light.cure
# Run the compiled program
erl -pa _build/ebin -noshell -eval "'TrafficLightDemo':main(), init:stop()."
# Run tests
make test