ASTREUM LANGUAGE
A stack-based language built on Expressions
Postfix evaluation over a simple data model of links, symbols, numbers, byte strings, and strings. Includes built-in concurrency with actors.
WHAT IT IS
Small, explicit, and content-addressed
A postfix language built around a stack-based virtual machine, built-in operators, and a content-addressed expression model. Designed for transparency, auditability, and deterministic execution in smart contracts and off-chain tooling.
Smart contracts
Metered execution with a clear stack model, content-addressed expressions, and explicit module boundaries keeps contract logic transparent and verifiable.
General applications
Write scripts, services, and tooling where clarity, composability, and content-based addressing matter — without sacrificing ergonomics.
Concurrent actors
Built-in actor model with message passing: spawn lightweight threads, send and receive over named mailboxes, all within the same expression evaluator.
FEATURE SUMMARY
Current version: 0.21.4
- Stack-based evaluation with postfix operator dispatch, a
'special form, and aquotestack operator. - Six built-in expression types as a single
Exprclass with a string_tag:link/symbol/bytes(base, direct wire encoding) andint/float/str(composed, serialize aslink(bytes(payload), symbol(tag))). User-defined types are open — any symbol creates a new type at runtime. - Open type system with structurally embedded tags — the type is the terminal symbol of every value's canonical link form. User types are created with
initand introspected withtype. Type names are also constructors:(3 5 point)constructs a point. - Built-in operators covering arithmetic, comparison, bitwise logic, stack manipulation, expression construction, type creation and conversion, byte-string operations, control flow, quotation, code/storage, and actor message passing.
- Content-addressed storage model with hash pointers (
head_hash/tail_hash) for DAG-based expression graphs, runtime hash resolution viaref/load, and binary serialization viato_bytes/from_bytes. - Module system with file imports, reference imports, prefix-qualified namespaces, and circular-import protection.
- Metered execution (
Meter/MeterExceededError) with size-based costing per operation. - Deterministic execution mode that disables
spawn,send,receive,eval,ref, andloadfor reproducible evaluation. - Scoped environments: lexical parent chains for lookup;
defwithinclosurewrites to the captured environment. - Tagged result operators — append
?to any operator name to wrap the outcome as(ok . value)on success or(err . reason)on error, enabling structured error handling without bare NIL checks.
EXPLORE
Learn more about the language
Syntax, operators, and the evaluation model.
Language SpecificationInstall the CLI, write your first file, and run it.
Getting StartedWalk through core concepts with runnable examples.
Language TourEBNF grammar, complete operator table, CLI flags, and reserved words.
Language Reference