Sisu learns from the languages we admire.
Python shows that code can be simple and easy to read. Rust shows that a compiler can rule out whole kinds of bugs. Swift shows that memory can be safe without a garbage collector. Sisu brings these lessons together in one small, statically typed language that compiles to native code.
enum Status {
Paid
Pending
Refunded(reason: string)
}
class Order {
item: string
price: f64
status: Status
}
fn main() {
let orders = [
Order(item: "sauna stones", price: 39.0, status: Status.Paid),
Order(item: "birch whisk", price: 12.5,
status: Status.Refunded(reason: "too stiff")),
Order(item: "wool socks", price: 18.0, status: Status.Paid),
]
let total = orders
.filter(o => o.status == Status.Paid)
.sum_of(o => o.price)
print("Paid: {total:.2} €")
}
// Paid: 57.00 €
What Sisu takes from each language
From Python
Readability
- Minimal syntax
- One obvious way to do a thing
From Rust
Correctness
- Immutable by default
- Invalid states are unrepresentable
- No null: optionals instead
- Error messages that help you fix the code
From Swift
Memory safety, simply
- Reference counting: no garbage collector, no borrow checker
What Sisu values, in order
When two values pull apart, the higher one wins.
- Correctness
The language makes wrong programs hard to write. Mistakes are caught early, at compile time where possible.
- Simplicity
Few concepts, rules without special cases, every effect visible where it happens.
- Readability
Code that reads top to bottom. Errors in plain words.
- Performance
Native code with predictable memory. Optimizations never change what a program means.
Where Sisu stands
Each row is one area of the project. The bar shows how much of it works today; open a row for the full list. Planned work can change and has no promised date.
Language 12 work today · 9 planned
Works today
- Nothing changes unless marked
mut - Functions,
ifas a value, loops - Classes with fields and methods
- Optionals instead of null
- Enums that carry data, including recursive ones
matchthat must cover every case- Integers that panic on overflow; IEEE 754 floats
- UTF-8 strings and formatting
- Arrays that behave like values
- Compile-time constants
- Generic functions, classes and enums
- Optionals that nest, such as
i64??
Planned
- Interfaces
- Errors with
Resultand? weakreferences- Closures and iterators
- Records, named and default arguments
- Modules
- Tests in the source file
- More number types
- Concurrency
No stability promise yet: any change may break programs.
Standard library 5 work today · 2 planned
Works today
- Printing and reading lines
- Program arguments
- Text as characters, bytes and words
- Float math
len,sumandcontainson arrays
Planned
- Lists and maps
- Files, environment and exit codes
Still small: many everyday tools are missing.
Compiler 6 work today · 7 planned
Works today
- Native code for x86-64 and ARM64 Linux and ARM64 macOS through LLVM
- Optimized builds with
-O2and-O3 - Reference counting, no garbage collector
- Panics that name the source line
- Front end fuzzed nightly
- Generated programs fuzzed nightly for wrong answers
Planned
- MIR, to remove reference-count updates that cancel out
- Debug info for
gdb - Windows
- Cross-compiling
- Calling C libraries
- A report of the bounds checks the optimizer keeps
- Lexer and parser in Sisu
Toolchain 2 work today · 4 planned
Works today
sisu: build, run, check, explain, show IR- Benchmarks on every pull request that touches the code
Planned
sisu runreuses the build of an unchanged scriptsisu test,sisu fmtandsisu lsp- Install without cloning
- Packages from a path or Git
Developer experience 5 work today · 8 planned
Works today
- Errors that point at your code
sisu explainfor all 157 codes- Fixes marked safe or unsafe
- JSON output for tools
- Warnings for unused names
Planned
- Formatter
- Language server
- VS Code highlighting
- More lints
- Recovery from syntax errors inside a function
- Leak finder (
--leaks) - Doc comments
- A language reference
The status page links each feature to its design notes. Built from the repository at commit a8614dc.
How a program becomes native code
sisu turns one source file into one executable. Each stage hands the next a simpler form of the program.
- Lexertext → tokensSplits the UTF-8 source into names, numbers and symbols.
- Parsertokens → ASTBuilds the syntax tree: the program as you wrote it.
- CheckerAST → TIRResolves every name and types every expression. Rewrites shorthand such as
forand??into simpler forms, and reports every error in one run. Its output is the typed tree, TIR. - MonoTIR → TIRCopies each generic function, class and enum once for each list of type arguments the program uses, so the stages after it see only concrete types.
- MIRTIR → MIRA mid-level form in which every reference-count change is its own statement. It hands over each counted value's reference at its last read, so an array can change in place without a copy, and debug builds check every function. Removing the pairs that cancel out within a block is built and awaits its measured verdict.
- CodegenMIR → LLVM IRWrites the program in LLVM's language.
- LLVMLLVM IR → objectOptimizes and writes x86-64 or ARM64 machine code.
- Linkobject → executableThe system C compiler,
cc, links it with the Sisu runtime.
All stages run in one process, with LLVM linked in as a library. Only the link step calls another program. More on the architecture
Build it and run a program
Sisu has no releases yet. You build the compiler from source, on x86-64 or ARM64 Linux or an ARM64 Mac. You need:
- The Rust toolchain; rustup installs the pinned version
- GNU Make, and a C compiler on
PATHascc - On Ubuntu:
libzstd-dev,libxml2-dev,zlib1g-dev; on macOS, Homebrew'szstd prek, whichmake setupuses to install the Git hooks
$ git clone https://github.com/sisu-lang/sisu $ cd sisu $ make setup # once per clone: LLVM 23 into .llvm/23 $ make build $ target/debug/sisu build crates/sisuc/tests/run/fib.sisu $ ./fib 832040
Built in the open
One person builds Sisu, in public, one reviewed pull request at a time. Every design choice is written down with its reasons.
The text on this page was checked against the repository at commit 85b0542.
Sisu