Skip to main content

Edva

A zero-keyword, expression-oriented systems language

Author

baldgeorge

1 Edva

Edva (.dva) is a statically typed, expression-oriented systems language with significant indentation, zero reserved keywords, unboxed two-slot ramifications, arena-backed memory management, and a self-hosted LLVM 18 compiler.

1.1 Core language invariants

Invariant Formal Specification
Source suffix & encoding UTF-8 text in .dva files; space-only indentation (E1011 on tabs)
No reserved keywords All control flow, branching, iteration, and returns use symbolic operators (|, [...], @, -->, --^, >--, --|); directives use # (#type, #use, #public, #private, #foreign, #export, #packed, #align, #size, #!)
Bindings & mutability Immutable by default (x = v); explicit mutability/rebinding via trailing primes (x' = v) or marked module globals (::g = v). Inline x: T = v is forbidden (E2009)
Separate signatures Function types are declared on a separate line (f: A, B => R) preceding f = a, b => body. Unannotated functions use Hindley-Milner-style unification and never default unknown types to Int (E3103 / E3128)
Fixed 64-bit Int Int is strictly 64-bit signed (i64) on all targets (including 32-bit wasm32); only Addr scales with target pointer width
Strings vs Builders String is an immutable 16-byte { i64 len, ptr data } fat pointer with NUL-reserved tail (data[len] == 0) and 16-bit arena generation tag (E4010 on stale read); Builder ({cap}) is a 24-byte mutable buffer frozen in \(O(1)\) via +b
Ramifications (Rams) Four static two-slot algebraic layouts replace booleans, options, and exceptions: <> (i1 flag), <T|> (option), <|E> (fallible), <T|E> (unboxed { i1, i64 } result)
Definite initialization Forward-declared records (r: Rec) are never zero-filled implicitly; every field must be written before reading (E3130)
No GC, no RTTI Memory uses scoped bump arenas and stack values; closures are { ptr fn_ptr, ptr env_ptr }; Type exists strictly at compile time (#!) and is erased before codegen

1.2 Specification map

Ch. Chapter Scope
1 Quickstart, Build & Tour Compiler build (make edva), CLI execution, symbolic syntax comparison, and end-to-end language tour
2 Lexical Structure & Literals Indentation, continuation, comments, identifiers, primes, numeric/rune/string/builder/ram literals
3 Declarations, Bindings & Modules =, ', ::, forward annotations, function signatures, #type, #use, visibility, #foreign, #export
4 Expressions, Choices & Cycles Calls ($, $>, $>>), choice guards ([...]), ranges (.., ...), cycles (@, -->, --^, >--), assignments, --|
5 Operators, Sections & Underscore Pratt binding powers (operators.yaml), chained comparisons, operator sections (* 2), accessor sections ((.f)), and _ / _i rules
6 Compiler Intrinsics (%) Zero-overhead LLVM scalar, SIMD vector, horizontal reduction, math, bit manipulation, memory, and %to_str intrinsics
7 Type System, Scalars & Unit Complete type taxonomy, Int (i8..u64), Float (f32, f64), Rune, and Unit (())
8 String & Builder Single/multi-line strings, ${expr} interpolation, generation tags, Builder growth, mass-append, and +b freeze
9 Flags, Ramifications & Error RamNN/RamPN/RamNP/RamPP layouts, niche optimization, |, !|, !!, --!, return sugars, and structured Error
10 Records, Tuples, Bitfields & Enums Product types, #packed, #align N, bitfields, SIMD tuples, and nominal tagged union enums (< V1, V2(T) >)
11 Arrays, Slices & Maps Growable arrays (T{}), non-owning slices (T[]), associative hash tables (K ^ V), and snapshot iteration
12 Functions & Closures Arrow types (A => B), { fn_ptr, env_ptr } ABI, lambdas, headless choices, closure capture, and pipelines
13 Compile-Time (#!) & Type Reflection #! CTFE, generic Type parameters, #size/#align, T.name/T.zero/?T, shape guards, and T @ f => unrolling
14 Memory, Arenas, Addr & FFI Arena lifecycle, ++ deep copy, ~~ lenses, Addr pointers, &, volatile @[addr], C ABI, and target triples
15 CLI & Package Manager (edva.ccl) edva compiler flags, package subcommands, edva.ccl manifest schema, multi-target builds, and vendoring
16 Compiler & Runtime Diagnostics Complete E1xxx–E7xxx lexer, parser, typechecker, runtime, codegen, and package error reference
17 Compiler Architecture, Bootstrap & Testing Self-hosted compiler pipeline, 3-stage fixed-point bootstrap, test suites, and documentation verification
Ref Standard Library 43 standard library modules (io, fs, net, json, ccl, regex, crypto, flate, img, kv, math, str, uring, etc.)