Specs, comptime, derive
There are no type parameters on declarations, no traits, and no impl blocks. Reuse is a spec: a template over comptime arguments that the compiler instantiates into a named, concrete module. Instantiation is content-addressed, so the same arguments always produce the same artifact.
public spec Stack(comptime T: Type) where size_of(T) > 0 {
public type Stack {
items: [T]
len: usize where len <= items.len()
}
public function push(s: mutable Stack, item: take T) -> () with {panic} { ... }
}
spec mypkg.stack.Stack(i32)
let s: Stack_i32.Stack = ...comptime evaluates an expression, a block, a parameter, or a target-conditional branch whose dead arm is dropped before typecheck. The derive vocabulary is fixed: eq, ord, hash, debug, clone, properties, serialize, deserialize. There are no user-defined derives; custom code generation is a spec.