A Pretty Good Formatting Pipeline

Anya Helene Bagge and Tero Hasu
Bergen Language Design Laboratory
Department of Informatics, University of Bergen
Bergen, Norway


Proper formatting makes the structure of a program apparent and aids program comprehension. The need to format code arises in code generation and transformation, as well as in normal reading and editing situations. Commonly used pretty-printing tools in transformation frameworks provide an easy way to produce indented code that is fairly readable for humans, without reaching the level of purpose-built reformatting tools, such as those built into IDEs. This paper presents a library of pluggable components, built to support style-based formatting and reformatting of code, and to enable further experimentation with code formatting.


  author =       {Anya Helene Bagge and Tero Hasu},
  title =        {A Pretty Good Formatting Pipeline},
  booktitle =    {Proceedings of the 6th International Conference on
                  Software Language Engineering},
  editor =       {Martin Erwig and Richard F. Paige and Eric {Van Wyk}},
  series =       {Lecture Notes in Computer Science},
  volume =       8225,
  pages =        {177--196},
  year =         2013,
  month =        oct,
  isbn =         {978-3-319-02653-4},
  doi =          {10.1007/978-3-319-02654-1_10},
  publisher =    {Springer-Verlag},
  location =     {Indianapolis, Indiana}


(define bagge-hasu-13-pretty
   #:title "A Pretty Good Formatting Pipeline"
   #:author (authors "Anya Helene Bagge" "Tero Hasu")
   #:date "2013"
   #:location (proceedings-location
               "Intl. Conf. Software Language Engineering"
               #:pages '(177 196))))

Publication Details

paper (as PDF)
slides (as PDF)
SLE 2013, co-located with SPLASH 2013

Additional Resources

Accompanying material
  • incl. code samples
Source code