Gradual typing
Type annotations are optional. The checker reports provable mismatches, and native compilation specializes provably typed values.
Plix is a fast, safe, gradually typed language. Iterate with the interpreter, then ship a native executable through Cranelift — same semantics, both paths.
func fib(n: int) -> int {
if (n <= 1) { return n; }
return fib(n - 1) + fib(n - 2);
}
struct Vec2 { x: float, y: float }
impl Vec2 {
func norm2(&self) -> float {
return self.x * self.x + self.y * self.y;
}
}
say("fib(20) = ${fib(20)}");
say("norm² = ${Vec2 { x: 3.0, y: 4.0 }.norm2()}");
$ plix run fib.px
fib(20) = 6765
norm² = 25
$ plix build fib.px -o fib && ./fib
fib(20) = 6765
norm² = 25
$ plix build fib.px -o fib
[1/3] parse ✓
[2/3] type+own ✓
[3/3] cranelift ✓
→ ./fib (native executable)
$ file fib
fib: ELF 64-bit LSB executable, x86-64
Everything you need to ship reliable software — without the ceremony.
Type annotations are optional. The checker reports provable mismatches, and native compilation specializes provably typed values.
Use own, & and &mut for static ownership and borrowing checks. auto and const use the lighter runtime model.
plix build emits a standalone native executable. No runtime dependency, no VM — just your code and the metal.
struct, impl and trait with &self / &mut self receivers. No data inheritance — composition by default.
Drop into the Python ecosystem with import py "numpy" as np; — CPython access through the C API, only when you opt in.
The repo verifies observable output parity between both execution paths for its examples, guards and fuzz inputs.
A single plix binary interprets, compiles, checks, tests, formats and lints. Add a plix.toml and it discovers your entry points automatically.
$ plix run app.px # interpret
$ plix build app.px -o app # native (Cranelift)
$ plix exec app.px # compile & run
$ plix check app.px # parse + type + own
$ plix test # *_test.px suites
$ plix fmt # format
$ plix lint # built-in lints
$ plix repl # interactive shell
A deterministic parity fuzzer generates programs and compares their normalized output across both modes — so what you test is what you ship.
v0.9.8 is a stabilization release. Compatibility and LTS commitments apply once 1.0.0 ships.
Grab a release archive, or build from source with a stable Rust toolchain. Python is only needed for the optional FFI.
$ git clone https://github.com/plixlang/plix.git
$ cd plix
$ cargo build --release --locked
$ ./target/release/plix --version