"Eternal Sunshine of the Rustfmt'ed Mind"
summary
Explains how Rust format 1.0 shipped using the compiler parser (referred to as Rosy), why that AST-based approach makes macros and maintenance hard, and why a custom IR between tokens and an AST plus far fewer options would be faster and easier to maintain. Gives concrete tradeoffs: shipped successfully in 2018, handles almost all crates but is slow on large files, struggles with macro source vs expanded AST, and the prototype approach accepts occasional line overflow to gain performance.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 0:30Why do we need a formatting tool
- 2:10Function declarations
- 6:54Comments
- 7:23Success
- 8:06RFC Process
- 11:23Design Space
- 18:44Conclusion








