turf lang
Turf is a statically-typed, LLVM-backed programming language. It compiles directly to native binaries, supports structs, enums, generics, state machines, modules, pointers, and native FFI, ships with a real standard library (strings, collections, file I/O, JSON, time, randomness, filesystem paths, networking), and includes an integrated compiler-diagnostics system built around a locally-run language model.
Turf's compiler pipeline is a standard deterministic front-to-back: lexer → parser → resolver → type checker → codegen, LLVM backend. Nothing about the compilation itself is probabilistic. What Turf adds on top is a diagnostics layer (--smart) that treats the compiler's own internal state as the source of truth for AI-assisted suggestions, rather than pattern-matching against formatted error strings — entirely local, no network call, no external dependency.
- Getting Started — install Turf and compile your first program
- Language Tour — the full syntax: types, structs, enums, error handling, generics, FFI, state machines
- Standard Library — every shipped module, per-function
- Compiler Architecture — the five-pass pipeline and why it's split this way
- The --smart Pipeline — how AI-assisted fix suggestions are generated, constrained, and sandbox-verified
- Examples — copy-paste programs you can tweak
- Roadmap — what's next on the way to self-hosting
Want the bigger picture? See Implementation.