* Implementation

How Turf Works

Turflang is compiled through a robust pipeline integrating static analysis, control-flow reasoning, and a unique tiered AI-assisted diagnostic architecture. It lexes and parses your .tr file into an AST, performs semantic checks (including multi-tier diagnostics using localized SLMs when opted-in), and leverages established LLVM optimization passes to generate a native executable.

The primary research contribution lies in its three-tier diagnostic architecture:

Compilation pipeline stages

Forward function calls

The compiler uses a pre-pass that hoists function prototypes, so you can call a function before its definition.

Debug: emit LLVM IR

turf example.tr -o example --emit-llvm