r/Compilers • u/Ill-Froyo-2461 • 7d ago
I built Oster with AI – a memory-safe language with NLL borrow checking that compiles to portable C11
Hey everyone,
I’ve been working with AI on Oster, an experimental programming language and compiler written in Rust that compiles down to portable C11.
Why Oster?
The main goal is to combine modern static safety guarantees (ownership, non-lexical lifetimes / borrow checking, escape analysis, exhaustive pattern matching) with the ubiquity and zero-runtime portability of standard C11 — making it easy to target anything with a C compiler and integrate seamlessly with existing C codebases.
My repo:
https://github.com/kapimati/Oster
What it looks like
Here is a small snippet in Oster:
extern fn puts(s: str) -> i32;
enum Result { Err(str), Ok(i32) }
fn checked_div(a: i32, b: i32) -> Result {
if b == 0 { return Result::Err("division by zero"); }
return Result::Ok(a / b);
}
fn sum_divs() -> Result {
mut let total = 0;
for d in \[2, 4, 5\] {
total += checked_div(100, d)?;
}
return Result::Ok(total);
}
1
u/Discordbothost 6d ago
What should checked_div return for -2147483648 divided by -1? The quotient won't fit in i32. That'd be a useful second test alongside division by zero.
1
u/LegitMoth 3d ago
you know the field is dead when tom pearl himself is vibecoding compilers