From 96b7ffb654fc77355f84e8ef21708f2274eb9fca Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 25 Sep 2026 10:10:33 +0700 Subject: [PATCH] A program stays one compilation, which is why a generic's body is always there --- TODO.org | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/TODO.org b/TODO.org index f0c1f584..542a1ca8 100644 --- a/TODO.org +++ b/TODO.org @@ -737,10 +737,12 @@ call site that asked for that type. The data is there — =instantiation_origin= exists and the session already uses it — and wiring it into every failure under an instantiation is a lane of its own. -** TODO Generics across a real compilation-unit boundary -It works today because =Load= flattens imports before checking. A package boundary -that ever becomes a real unit boundary needs the generic's body to cross it, which -separate compilation cannot do — which is why C++ puts templates in headers. +** DONE A program is one compilation, so a generic's body is always visible +CLOSED: [2026-09-25] +Odin's and Zig's model: packages are never compiled separately. The cost is build +time proportional to the whole program and no binary-only packages. If separate +compilation is ever wanted, Rust's answer is the one to take — a compiled package +carries its generics' checked bodies and the user instantiates them. ** DONE Collapsing the prelude buys 27 to 15, not 27 to 6 CLOSED: [2026-09-13]