The language
ErnosPlain is a compiled language designed to read like a set of instructions. It can translate programs into C, check types and ownership before they run, and build its own compiler through a verified self-hosting chain. The language is MIT-licensed and is used throughout the Ernos Labs software and scientific tooling.
define add with a and b: — no braces, no semicolons.
The compiler emits C, then uses Clang to produce a native program.
Type and ownership checks identify incompatible values and unsafe use before execution.
Successive compiler generations produce byte-identical output in the verified self-hosting test.
Run it
Edit the code and press Run. This isn't a video — it's a real ErnosPlain interpreter executing in your browser.
And here's the twist: that interpreter is itself written in ErnosPlain, compiled to the browser by the Ernos compiler. The language is running itself.
Live REPL
A persistent session — set a variable or define a function on one line, use it on the next. Enter runs · Shift+Enter for a new line · Tab indents.
A real program
This isn't a toy. It's one of ErnosPlain's shipped demos —
rpg_battle_system.ep, 362 lines — compiled to JavaScript by the very same Ernos compiler that
builds it to native C. It exercises the hard parts of the language at once: structs,
a trait with implementations for three types, a
choice enum wrapping them, and dynamic
dispatch over a mixed party.
Hit Fight — a party of two takes on two monsters. Damage and 20% criticals are randomised, so every battle plays out differently. Run it a few times.
Press Fight to run the battle. The same code compiles to native C — here it's running as JavaScript, in your browser.
Why plain English
ErnosPlain compiles to the same machine code as C — it just doesn't make you read like a machine to get there.
define factorial with n returning Int: if n is less than 2: return 1 return n times factorial(n minus 1)
fn factorial(n: u64) -> u64 {
if n < 2 { 1 }
else { n * factorial(n - 1) }
}
unsigned long factorial(
unsigned long n) {
if (n < 2) return 1;
return n * factorial(n - 1);
}
Under the hood
No interpreter at runtime, no VM. Every .ep file walks
the full compiler pipeline down to an optimised native binary.
The compiler that does all this is written in ErnosPlain itself — it compiles its own source. The playground above is the same idea in miniature: an ErnosPlain interpreter, authored in ErnosPlain, running in your browser.
define greet with name returning Str: return f"Hello, {name}" set who to "world" display greet(who)
set i to 1 repeat while i is less than 5: if i % 2 equals 0: display "even" else: display "odd" set i to i plus 1
define structure Point: field x as Int field y as Int set p to create Point: x is 3 y is 4
define choice Shape: variant Circle with r as Int variant Square with s as Int check shape: if Circle with r: return r times r if Square with s: return s times s
The playground supports a procedural subset (variables, functions, recursion, conditionals, loops, lists, strings, f-strings). The full language adds structures, choice/pattern-matching, traits, closures, a borrow checker, 24 stdlib modules, and FFI — all compiled to native binaries.
Get the language
MIT-licensed. Clone it, build it, run the flagship demo — The Plainville Bakery, a day-in-the-life program that exercises every major feature in ~300 lines of plain English: structs, traits, enums, error handling, closures, async ovens, worker threads, and a plain-English insertion sort.
git clone https://github.com/MettaMazza/Ernos-Programming-Language
cargo build --release # or: bash bootstrap/verify.sh — no Rust needed
./target/release/ernos examples/bakery.ep