A New Standard ML Prettyprinter Library, An Experience Report
summary
A new Standard ML prettyprinter library claims a simpler, more predictable design by synthesizing PPML and Hughes/Wadler ideas, implemented as modules in a strict purely functional style that uses a format intermediate data structure and a conservative flat measure for lookahead. Rendering is essentially linear, avoids laziness, and supports blocks, alignments, soft/hard breaks, indent and alt choices. The implementer iterates 10+ times and has reimplemented 11 non-trivial pretty-printers successfully, so the design works for typical compiler ASTs.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:03Frustrations with old printer
- 2:28Prettyprinting history
- 6:54Design goals
- 9:43Core concepts
- 12:57Indentation and flattening
- 14:05Conditional rendering
- 17:37Rendering process
- 18:39Example: tree prettyprint
- 20:29Real-world usage
- 21:34Enhancements and future
- 24:46Conclusion
- 26:55Where to find the library
related talks
27mProduction Language Specification - Requirements for Multiple Usages
32mA Survey of Weak Reasoning Assistants
54mPanel: Mechanized Specifications for Real-World Programming Languages
32mPRETTY LITTLE COMPILERS
20mNever again in outer par mode: making next-generation PDFs with Quarto & typst
20mA Core Calculus for Documents: Or, Lambda: The Ultimate Document
41mTeaching Domain Specific Languages in Scala
19mReproducible, dynamic, and elegant books with Quarto
