Skip to content
Weaverv0.5.0

Intent and principles

Weaver is a natively compiled, statically typed language without GC, whose compiler executes the language itself. The code that enriches the program is therefore written in the same language as the program. The name comes from weaving. The warp, stretched on the loom before weaving, is what compilation fixes: the types, the contracts, the meta code. The weft passes between its threads and makes the fabric: it is the code that runs, and it gives the sources their extension, .wft (weft). Tasks, lightweight threads (8.2), are woven on the same loom.

  1. One language, two moments. meta code (compilation) and ordinary code (execution) share syntax, types and libraries.
  2. No runtime reflection. Everything derived from a type (serializer, validator, mapper) is generated at compile time.
  3. Values first. No GC and no lifetimes: value semantics, second-class references, inferred reference counting.
  4. Nothing gets lost. A resource cannot be forgotten, and the error of its disposal cannot be swallowed.
  5. Implicit in the text, explicit in the tool. Inferred costs (allocation, copy, counting) are shown by the IDE and can be required by assertion.
  6. Progressive complexity. Everyday code annotates nothing; mut, arena and unsafe appear only where they are useful.
Borrowed from What Weaver keeps from it
Java Contracts tied to syntax (Iterable, AutoCloseable), streams
Scala Algebraic types, pattern matching, functional style
TypeScript Unions, literal types, computation on types
Go defer, field tags, simplicity, fast compilation, canonical formatter
Rust Unique ownership, Result and its propagation
Zig comptime, types as values, errdefer
C# using as a declaration
Hylo Mutable value semantics, passing conventions
Koka Precise reference counting with in-place reuse
D, Scala Lazy parameters (lazy, by-name)