Tekst
Source
Documentation/Getting Startedsource tree
Learn

Getting Started

Go from an empty directory to a native Tekst executable in a few minutes, or try Tekst in your browser without installing anything.

Install the compiler

Build Tekst from source with a C++17 compiler, CMake 3.16 or newer, and LLVM/Clang. On Windows, the native toolchain uses Clang with the MinGW-w64 GNU target.

terminal
cmake -S . -B build
cmake --build build --config Release

The resulting executable is named tekst on Linux and macOS, or tekst.exe on Windows.

CMake places the built compiler executables in build/release/. On Windows this includes tekst.exe and tk.exe.

Your first program

hello.tk
print("Hello, World!")
terminal
tekst hello.tk

Add some data

variables.tk
name = "Ayaan"
age = 14
print(name)
print(age)

Make a decision

conditions.tk
age = 14

if age < 18:
    print("Not an adult")
else:
    print("Adult")

Compile and run

Choose an output name with -o, or ask Tekst to compile and immediately run the program with --run.

terminal
tekst main.tk -o main
tekst main.tk --run

Inspect LLVM IR

The compiler can emit the LLVM IR generated from your Tekst program. This is useful when learning how Tekst reaches native code.

terminal
tekst main.tk --emit-ir > main.ll

Where to go next