Write Python
Run Rust
Sifr compiles Python into safe, native Rust binaries.
No runtime interpreters, no virtual machines, and minimal runtime crashes.
curl -fsSL https://sifr.sh/install | shThe Power of Sifr
Explore Sifr's absolute safety and raw speed.
Zero Overheads Performance
The trick: no trick, Sifr uses the great Rust compiler behind the scenes
Performance Insights
Elegant Error Handling
Sifr treats errors as values, not surprises. The compiler rejects code that could silently ignore unhandled errors.
def parse_age(s: str) -> Result[int, ParseError]:return int(s)def main():parse_age("25")# ERROR: unused Result value
error[SIFR-RESULT-0001]: unused Result value of type 'Result[int, ParseError]' must be used
def main():try:age: int = parse_age("25")print(f"Age is {age}")except ParseError as e:print(e.message)
Static Types That Follow Control Flow
Sifr rejects unsafe transactions until your code handles the missing case, automatically narrowing the type subsequently.
def add_one(x: int | None) -> int:return x + 1def main():print(add_one(41))
error: cannot use `int | None` as `int` help: check whether `x` is `None` before using it as an integer
None case, Sifr blocks compilation, keeping unsafe code away from production.def add_one(x: int | None) -> int:if x is None:return 0return x + 1def main():print(add_one(41))
None case, Sifr automatically narrows x to int on the subsequent lines.A Compiler Agents Can Read
Sifr is built for the way software is written now: by humans and AI agents working together.
Humans need code they can read. Agents need errors they can parse.
Both need a compiler that stops bad assumptions before they ship.
Readable for humans. Parseable for agents. Strict enough to stop both from shipping unsafe code.
def add_one(x: int | None) -> int:return x + 1def main():print(add_one(41))
The parameter 'x' is marked as potentially None. Adding an integer directly to x triggers Sifr's type safety check, preventing invalid memory state.
For humans, Sifr explains the mistake at the exact line, column, and file range that caused the error.
The Sifr Compiler Pipeline
Trace how a single Python statement transits through the compiler layers. Sifr enforces type safety, checking memory and type structures to generate highly optimized native machine executables.
1. Pythonic Source
Write clean, highly-readable Python syntax with explicit type annotations. Standard functions and loops are parsed with absolute simplicity.
Standard parameters and variables are declared with clean types. Sifr is fully compliant with standard Python IDE type checking.
# main.sifrdef double(value: int) -> int:return value * 2result: int = double(21)print(result)