One Rule, Not a Pile of Exceptions
Constructors, operators, and properties aren't special syntax — they're all just typed members. The same rules govern everything.
Leviathan is a new statically-typed, object-oriented language, drawing on ideas from C++, C#, TypeScript, and Haskell. It's being designed around a simple conviction: most of what looks like a language's "special case" is really just a general rule nobody has bothered to find yet. Leviathan tries to find that rule, instead of adding another exception.
The result leans explicit over implicit, treats safety as the default rather than an opt-in, and still keeps a clearly marked door open for the rare moment you need to reach for raw power. It's early — the compiler, standard library, and tooling are all being built in the open, one deliberate decision at a time.
Constructors, operators, and properties aren't special syntax — they're all just typed members. The same rules govern everything.
Inherit from more than one class without the classic diamond-problem headaches. Collisions are caught automatically and resolved explicitly, member by member.
Absence is a real, typed value instead of a landmine hiding in every reference. Your code can't quietly forget to check for it.
The everyday path is guarded and predictable. Raw power still exists — it just requires you to reach for it deliberately.
Branch on type or value with one readable construct, instead of a
chain of if/else and manual casts.
Files, sockets, timers, and everything else that talks to the outside world flows through one consistent idea: the stream.
Leviathan is still taking shape, but here's a small sample of what writing it actually looks like.
No boxed wrapper types — numbers and strings carry real methods, unboxed.
(-7).abs() // 7
"Hello".toUpper() // "HELLO"
(42).toString() + "!" // "42!"
Colliding members from different bases stay separate, explicitly, instead of silently merging or refusing to compile.
class Counter { public distinct int value = 0; }
class Tag { public int value = 99; }
class Widget : Counter, Tag {
new Widget() {
this.Counter::value = 5; // two distinct 'value' slots —
this.Tag::value = 7; // no diamond problem, no ambiguity
}
}
Match on type or value with one readable construct, exhaustively checked at compile time.
string describe(IShape sh) => match (sh) {
Circle => "circle";
Square => "square";
else => "shape";
};
T? is sugar for a real union with None — absence you can't forget to handle.
string? token = request.header("Authorization");
console.writeln(token ?? "none provided");
Leviathan is being built in the open. This page will keep growing as the language does — check back at leviathan-lang.com for updates.