Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 880 Bytes

RFC-0015-Module-Graph-And-Tree-Shaking.md

File metadata and controls

26 lines (18 loc) · 880 Bytes

RFC-0015: Module-Graph-And-Tree-Shaking

Status: Draft v0.1
Author: Raccoon Core Team
Date: 2025-10-05

Summary

Module graph, side-effects model, and dead-code elimination (tree-shaking).

Units & metadata

.rco objects, .rclib archives, .rcmeta export tables. Symbols with vis/effects/generics/side-effect flags.

Reachability

Roots: main, public API, @keep, @init, CLI --retain. Mark & sweep over IR refs, vtables, generic instantiations.

Side-effects

@init for top-level init; @side_effect for effect-only modules; explicit _effects imports retain them.

Generics

Monomorphise only used instantiations; cache by (def,args).

CLI

--dce=on|off|aggressive, --retain, --why-kept, --print-graph.

Lints

UNUSED_IMPORT, UNUSED_SYMBOL, IMPORT_EFFECTS_DISCARDED, REFLECTION_REQUIRES_KEEP, INIT_WITHOUT_USAGE.