Module Shapes for Modern Tooling
summary
Adds a compact language called Shapes to the OCaml compiler that represents module structure and tracks definitions through functor application, includes, aliases and projections, using beta-reduction and shape-level reduction rules to compute origins. Compiler changes produce shape metadata consumed by Merlin and tooling to answer "where is this defined" precisely and efficiently, and successfully fixes multiple long-standing broken go-to-definition and find-references cases across complex module hierarchies.
AI-written summary · about
chapters (7)
- 0:00Module shapes in tooling
- 4:32Complex module systems
- 6:46Module shapes structure
- 8:31Abstraction and identity
- 11:41Reduction rules and translation
- 14:14Compiler integration benefits
- 15:46Future applications and conclusions
related talks
34mImplementing Object Shapes in CRuby
24mOn the design and implementation of Modular Explicits
28mImplicit modules, a middle step towards modular implicits
16mA metalanguage for multi-phase modularity
49mRoll Your Own Shapeless
21mTail Modulo Cons, OCaml, and Relational Separation Logic
22mProject-wide occurrences for OCaml, a progress report
20mModern DSL compiler architecture in OCaml our experience with Catala
