Tooling
Formatting, linting, and testing for a consistent turflang workflow
Turf’s “tooling” is centered around a single CLI compiler, turf. During compilation it also runs heuristic lint checks and prints human-friendly diagnostics.
Compile a program
Usage:
turf <filename.tr> [-o output] [--emit-llvm]
Example:
# compile and link (default)
turf hello.tr -o hello
# run the produced binary
./hello
Emit LLVM IR (debugging)
To write LLVM IR text instead of producing a native binary:
turf hello.tr -o hello --emit-llvm
# produces: hello.ll
Build from source (repo workflow)
If you want to update the compiler and run the test suite locally:
# from the turf-lang repo root
./scripts/update_compiler.sh
./tests/run_tests.sh
Diagnostics and lint warnings
Turf compiles top-level statements and, before code generation, runs lint checks on the parsed AST. Lint warnings are emitted (they do not stop compilation), while actual errors prevent IR generation and linking.
Notes
- Source files use the
.trextension. - Semicolons are optional;
turfskips;tokens when present.