Compiler
Lexing, parsing, AST handling, lowering, LLVM IR, code generation, diagnostics, and command-line behaviour.
Tekst is a language, compiler, runtime, documentation set, and developer toolchain. This guide gives contributors a practical path from first checkout to a focused, testable change.
A good contribution does not have to start inside the compiler. Documentation, examples, diagnostics, tests, tooling, and runtime work all improve the language.
Lexing, parsing, AST handling, lowering, LLVM IR, code generation, diagnostics, and command-line behaviour.
Built-ins, memory operations, collections, objects, native runtime behaviour, and compiler/runtime boundaries.
Language explanations, reference pages, examples, tutorials, release notes, and keeping documentation aligned with the compiler.
CLI improvements, build workflows, package handling, examples, tests, and developer experience.
The current compiler is built around C++17, CMake, and LLVM/Clang. Keep the build directory separate from the source tree and use a release configuration when checking compiler output.
cmake -S . -B build
cmake --build build --config Releasetekst --version
tekst examples/hello.tk
tekst examples/hello.tk --emit-irCMake places the compiler executables in build/release/; Windows builds include tekst.exe and tk.exe.
Tekst follows a compact compiler pipeline. A focused change is easier to review when it has one clear responsibility and a small reproduction program.
Converts source text into tokens and preserves the lexical structure needed by the parser.
Consumes tokens and builds the abstract syntax tree for the indentation-based language.
Provides the structured representation consumed by later compiler stages.
Lowers language operations into LLVM IR and connects the program to native runtime functionality.
.tk / .tekst
↓
Lexer
↓
Parser
↓
AST
↓
LLVM IR
↓
LLVM / Clang
↓
native executablex = 41
p = &x
*p = 42
print(*p)Start from a concrete behaviour. Reproduce it, make the smallest useful change, build the compiler, run a focused example, and inspect the resulting diff before opening a contribution.
1. Reproduce the behaviour
2. Identify the responsible layer
3. Make the smallest useful change
4. Build the compiler
5. Run a focused program
6. Inspect LLVM IR when useful
7. Check nearby documentation
8. Review the diffuse mathpkg
print(mathpkg.square(8))
from mathpkg use square
print(square(9))Prefer clear semantics and small implementations that another contributor can understand without archaeology.
Tekst has a deliberately small surface. New syntax should solve a concrete problem rather than add complexity for its own sake.
A feature is easier to trust when its syntax, semantics, examples, and limitations are written down beside the implementation.
Start with the compiler documentation, inspect the release history for the current toolchain, then choose one focused improvement.