Roadmap
What v1.0.0 completed, and what comes next on the way to self-hosting.
Turf is v1.0.0. Every phase of the completed roadmap is done: the full language backbone (FFI, do/while, compare, enums, bitwise/string ops, first-class functions, error handling, for-each loops, state machines, operator overloading), unsafe { }/&T safe references, the standard library rewrite via FFI, the --smart diagnostics retry loop, and diagnostics polish (source spans, error codes + turf --explain, broader “did you mean?”).
Turf v1.x (post-1.0.0, pre-self-hosting)
Roughly in priority order:
1. Developer tooling
An LSP server (turf --lsp), turf fmt, turf test, and a package manager (tpm). Purely mechanical, no dependencies on anything below — this is what makes a tagged 1.0.0 pleasant to actually build things with day to day.
2. @slm { } in-source syntax (Prompt-Oriented Programming)
The --smart error-healing pipeline shipped for 1.0.0 (see The --smart Pipeline and SLM Integration) was a deliberately narrowed slice of a larger idea: letting a Turf program itself contain a natural-language block the compiler turns into real AST nodes, not just SLM-assisted error healing.
The concrete implementation path: a new @slm { "prompt" } syntax parsed into an SLMBlockExprAST node; structured context serialization that extracts the current function signature and all visible variables/types to build the prompt prefix; and a query loop where the returned string passes through the full Lexer → Parser → Resolver → TypeChecker pipeline, retrying up to 3× on TypeChecker failure by feeding the error back into the prompt — the same retry shape --smart already ships, applied to a block-codegen target instead of a single suggested line.
3. LoRA fine-tuning for the local SLM
Two planned adapters: one for syntax and instant fixes (already useful for today’s --smart path, no dependency on item 2), and one for AST generation (specifically for @slm block codegen, useful once item 2 ships).
4. Standard library expansion
Further gap-filling on top of the module list in Standard Library — more of strings, deeper os, and the collections/generics fixes tracked as known limitations, prioritized by what’s actually blocking real programs. Concretely: a hashed HashMap<K, V> (today’s map/collections::set are linear-scan association lists), and ideally a trait/constraint system that would let Map<K, V>/Set<T> dispatch == correctly for K/T = string — the documented limitation.
5. Memory architecture (ARC)
The proposed memory-architecture RFC: automatic reference counting, safe references replacing raw pointers as the default, heap-allocated mutable strings/arrays, and an unsafe_ptr<T> FFI bridge. Today’s model is entirely manual — raw pointers gated behind unsafe { }, &T giving a non-null guarantee only, no GC. This is explicitly a memory-model change (compiler + Codegen work), not a stdlib addition — the narrow unsafe {}/&T track that shipped for 1.0.0 was a deliberate subset of this, not a first step that makes the rest smaller. Gated on items 1–4 landing first.
6. CFG static analysis remainder
Pointer nullability tracking, real memory-leak detection (distinct from the already-shipped use-after-free/double-free tracking described in Tooling), bounds-check elimination on top of the value-range pass, and a working CallGraphPass::runGlobal() (currently a confirmed no-op — see the note at the end of the CLI reference). Independent of everything else on this list.
7. SLM-driven and other language paradigms (speculative)
Pure design sketches with no code behind them yet: a self-healing compiler, semantic interface matching, extreme compile-time execution via ORC JIT, region-based memory management as an ARC alternative, and reversible execution.
Turf 2.0.0: self-hosting
The final milestone: writing the Turf compiler in Turf itself. Both hard requirements are already satisfied today — extern fn FFI (to bind LLVM’s C API) and std/io.tr (to read/write source and object files).
Bootstrap cycle:
- Write new compiler logic using existing Turf features.
- Compile using the current compiler binary.
- The output is a new binary that understands the new feature.
- Use the new feature in everyday Turf programs.
The compiler’s own SLM calls would become ordinary extern fn FFI calls binding llama.cpp’s C API directly, rather than the C++-side integration --smart uses today. Realistically this waits until most of the v1.x list above has landed — self-hosting a compiler that’s still missing basic dev tooling, a stable stdlib, and its own headline language feature (@slm {}) would mean redoing that work twice.