EN 中文

Silu.

A concise, self-hosted, compiled language with Python syntax.

def greet(name: str) -> str:
    return "Hello, " + name + "!"
 
print(greet("Silu"))
 
$ ./siluc hello.si -o hello   # 0.11s, LTO by default
$ ./hello
Hello, Silu!

Early stage — documentation is published now; binary releases come next; source will follow in stages.

Writes like Python, runs native

15.6×
vs CPython — geometric mean, 15 programs
0.004s
native startup
0.9×
vs hand-written Rust twins (same report)
ProgramCPythonSilu nativevs CPythonRust (reference)
arith80ms3.3ms24.4×2.9ms
dict34ms2.2ms15.6×2.8ms
fannkuch32ms2.6ms12.1×2.5ms
fib36ms2.5ms14.2×2.8ms
float52ms2.7ms19.3×2.8ms
jsonparse47ms7.4ms6.3×3.6ms
jsonparse_json42ms7.9ms5.3×—
knucleotide889ms11.0ms80.9×14.8ms
list35ms2.4ms14.8×2.4ms
mandelbrot41ms2.4ms17.2×2.7ms
nbody214ms5.7ms37.6×5.4ms
spectral288ms7.4ms38.7×4.7ms
string49ms3.0ms16.1×2.2ms
trees31ms3.2ms9.8×3.4ms
wordcount88ms23.3ms3.8×13.7ms

v1.9.0 report (2026-10-25), Apple Silicon, medians of 3 runs including process startup; outputs byte-identical across the interpreter / CPython / native / Rust planes. Against the Rust twins the geometric mean is 0.9× in this report — some programs faster, some slower. Later toolchain work (LTO-by-default linking, string pooling, buffer reuse) further improved jsonparse, spectral and wordcount; see the benchmarks doc.

Prove, or get the counterexample

⚡

Real proofs, not sampling

a / (b*b + 1) is proved safe by algebraic reasoning — the divisor is always ≥ 1, over all possible inputs. Fuzzing can't say that.

🎯

Witnesses for real bugs

m / (n - n) is flagged with a counterexample — the divisor is identically zero. You get the crashing input, not just a warning.

🔗

Contracts compose

require(b != 0) declares a function's domain. The function proves safe standalone; callers are checked separately. Removing a caller never invalidates anything.

Scope today: division by zero, list/string index bounds, dict keys. Loops are verified to a fixed bound; obligations the solver cannot discharge are reported as unproved — never silently assumed safe.

$ cat safe.si
def safe_div(a: int, b: int) -> int:
    require(b != 0)
    return a / b
 
$ silu prove safe.si
safe_div: ok (1 checked abort site(s) proved safe)
verify: ok - no abort reachable
 
$ cat buggy.si
def risky(m: int, n: int) -> int:
    return m / (n - n)
 
$ silu prove buggy.si
risky: POSSIBLE ABORT - division by zero
verify: ABORT REACHABLE

Self-hosted, and it can prove that

The compiler is written in Silu

Lexer, parser, IR generator, LLVM code generator — all Silu, compiled to a native binary by itself. The fixed-point check — the self-hosted converter reproducing its own build output byte-for-byte — runs in the test suite.

One command bootstrap

silu bootstrap builds the zero-Python toolchain from source in ~25 seconds. After that, every compile is ./siluc file.si -o prog — 0.11 seconds, LTO by default.

Ownership, no GC

Static annotations decide representation: int lives on the stack, str is an owned buffer dropped at scope exit, containers are unboxed. Assignment transfers ownership. The trade-offs — including today's deliberately simple dynamic plane — are written up in the memory doc.

Fast Compilation

0.11s
siluc per compile (LTO default)
25s
one-time bootstrap
~2ms
binary startup
$ ./siluc hello.si -o hello
✓ compiled in 0.11s (LTO)
$ ./hello
Hello, Silu!