Types & Values
Achronyme is dynamically typed. All values are represented as tagged 64-bit words with a 4-bit tag and 60-bit payload.
| Type | Examples | Description |
|---|---|---|
| Int | 42, -7 | 60-bit signed integer (-2^59 to 2^59-1) |
| Bool | true, false | Boolean values |
| String | "hello" | UTF-8 strings (heap-allocated) |
| List | [1, 2, 3] | Ordered collections |
| Map | {"a": 1, "b": 2} | Key-value maps |
| Field | field(42), field("0x2a") | BN254 scalar field element |
| Function | fn(x) { x + 1 } | First-class functions and closures |
| Proof | result of prove { } | Groth16 or PlonK proof object |
| Nil | nil | Absence of value |
Integers
Section titled “Integers”Integers are 60-bit signed values stored inline (no heap allocation). Range: -576460752303423488 to 576460752303423487.
let x = 42let y = -7let big = 100000000000If an arithmetic operation overflows the i60 range, the result is automatically promoted to a FieldElement on the heap.
Booleans
Section titled “Booleans”let yes = truelet no = falseIn circuits, true maps to field element 1 and false maps to 0.
Strings
Section titled “Strings”let greeting = "hello, world"let empty = ""let nums = [1, 2, 3]let mixed = [1, "two", true]let nested = [[1, 2], [3, 4]]let person = {"name": "Alice", "age": 30}Field Elements
Section titled “Field Elements”BN254 scalar field elements for cryptographic operations. Montgomery form internally.
let a = field(42) // from integerlet b = field("0xFF") // from hex stringlet c = field("21888242871839275222246405745257275088548364400416034343698204186575808495617") // from decimal string
let sum = a + blet prod = a * blet inv = field(1) / a // modular inverseField elements are essential for circuit programming — all circuit values are field elements under the hood.
let nothing = nilnil represents the absence of a value. Functions without a return statement return nil.
Variable Bindings
Section titled “Variable Bindings”let x = 42 // immutable bindingmut y = 0 // mutable bindingy = y + 1 // reassignment (only for mut)let creates an immutable binding. mut creates a mutable binding that can be reassigned.