Structured diagnostics for the OCaml compiler
summary
Adds machine-readable S-expression output and a small DSL that generates serializers, printers and validators for compiler diagnostics. Implements a versioned ADT model with additive subtyping: new record fields are safe, variant arguments can be expanded by wrapping old payloads in a content field, and new constructors carry an approximate mapping to older kinds so old tools degrade gracefully. Prototype serializer/validator and a toy XML validator exist and survive minor compiler changes while preserving backward compatibility.
AI-written summary · about
chapters (10)
- 0:00Structured diagnostics in OCaml
- 1:23Text to machine-readable output
- 2:52Structured data types and versioning
- 5:02Subtyping rules for error types
- 7:31Variant constructors in versioned formats
- 11:01Breaking changes and compatibility
- 12:07Versioning with algebraic data types
- 15:28Generating output with a DSL
- 16:55Schema validation and tooling
- 18:01Q&A
related talks
40mThe Journey of a Dotty Diagnostic
27mTry-Mopsa: Relational Static Analysis in Your Pocket
01h 29mHaskell Summer of Code Presentations
38mType System Foundations for Super-Charged Semantic Code Search
33mHidden Gems of TypeScript compiler
07h 18mFull Workshop
38mLiving with Spec
27mParsing, Compiling, and Static Metaprogramming
