LEVIATHAN v0.1 · in development

leviathan-lang.com / docs

Leviathan Documentation

Leviathan is a statically-typed, object-oriented language built from first principles — one rule where other languages pile up exceptions. These docs come in two halves: a hands-on tutorial that teaches the language front to back, and a complete reference organized by feature category, with a runnable example for nearly every entity.

The reference, by category

Every page below documents one family of features and shows it in use.

Foundations Lexical & Literals

Comments, identifiers, keywords, and every literal form — numbers, strings, chars, arrays, ranges.

Foundations Types & Generics

Primitives as objects, unions and optionals, var/let, value vs reference, generics and HKT.

Foundations Expressions & Operators

Precedence, calls, member access, method dispatch, match, and operators as methods.

Declarations Classes & Interfaces

Classes, interfaces, multiple inheritance, and distinct collision resolution.

Declarations Members & Accessors

Fields, methods, constructors, operators, get/set views, and the const/readonly/weak axes.

Declarations Structs & Enums

Value structs, enums over a closed member set, and columnar storage.

Declarations Namespaces & Injection

Namespaces, use/uses imports, and bind/inject dependency injection.

Control Statements & Control Flow

Declarations, loops, match, and loop control — break, continue, do-while.

Control Errors & Resources

Exceptions, the IException hierarchy, using, and IDisposable cleanup.

Library Collections & Iteration

Pure Array, Map, Set, Pair, Range, the iterator protocol, and lazy Seq.

Library Strings, Chars & Regex

The string toolkit, char and UTF-8, StringBuilder, and the linear-time regex engine.

Library Concurrency & Async

Promise, await and tasks, workers and channels, cancellation and TaskGroup.

Library Streams, I/O & Network

The stream boundary, files, sockets, HTTP, TLS, timers, and child processes.

Library JSON, Time & Bytes

json, DateTime/Duration, encoding & digests, math, and the Block byte buffer.

Library Metaprogramming

Attributes, rules, comptime, body-replacing rewrites, and procedural macros.

Toolchain Compiler & Projects

The leviathan compiler, backends, and trident — manifests, dependencies, and packages.

A note on status

Leviathan is under active development. The reference tracks the language as implemented; anything designed but not yet built is marked planned. Where a feature runs on some compiler backends and not others, that's called out too.