Types
§Primitive types
| Type | Description |
|---|---|
i64 | 64-bit signed integer |
str | string — fat pointer (start, end) |
pid | process identifier — fat pointer to a process context |
All values are 64-bit at the machine level. Strings are stored as read-only data with a fat pointer; process ids are heap pointers that remain stable for the lifetime of the process.
§Where types appear
In a typed parameter:
n i64
buf str
target pidIn a literal guard:
0 i64
"hello" strThe literal guard requires the type alongside the literal — types disambiguate dispatch when several branches share the same arity.
§Type-based dispatch
When a machine is called, the compiler hashes the types of the arguments to pick a branch. Within a single type signature, literal guards are then checked in declaration order.
counter is {
0 i64 -> { ... } # picked when arg is the i64 literal 0
n i64 -> { ... } # picked for any other i64
}A call counter(5) matches the second branch. A call counter(0) matches the first.
The hash of types is computed at compile time, so dispatch is O(1) at runtime regardless of how many branches a machine has.
§Process identifiers (pid)
A pid is a handle to a spawned process. When a machine is called, it returns a pid you can store, pass around, and send messages to.
let p pid = receiver()
p(42) # sends the message 42 to receiverA pid is a stable heap pointer; it identifies the process for its entire lifetime. See State transitions for spawn/send semantics, and Expressions for the receiving side (wait).