DEV Community

Oster
Oster

Posted on

A programming language written with AI in rust

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);
}

Top comments (0)