Zulip Chat Archive

Stream: lean4

Topic: Pretty printing library


Chris B (Jul 14 2021 at 06:53):

I finally figured out how to get imports to work in Lean 4, so I made this a repo. https://github.com/ammkrn/printiest

It's a pretty printer based on Jean-Philippe Bernardy's "Prettiest" printer, which is a very cool way of making the on-paper-exponential exploration of all rendering combinations linear relative to the input size. The API is really nice to work with, and the design eliminates a lot of the compromising and guesswork that common when deciding on a layout with a standard pretty-printer.

If nothing else, take this as another very positive though anecdotal performance report. For the most part I guessed at what data structures to use since Lean 4 is so new, but this (when compiled) performs shockingly well compared to a similar rust implementation and the reference Haskell version.


Last updated: Dec 20 2023 at 11:08 UTC