A Pretty Good Formatting Pipeline

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

Abstract

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.

BibTeX

@inproceedings{bagge-hasu-13-pretty,
  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}
}

Scribble

(define bagge-hasu-13-pretty
  (make-bib
   #: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

DOI
10.1007/978-3-319-02654-1_10
Preprint
paper (as PDF)
Presentation
slides (as PDF)
Conference
SLE 2013, co-located with SPLASH 2013

Additional Resources

Accompanying material
http://nuthatchery.org/sle13/
  • incl. code samples
Source code
https://github.com/nuthatchery/pgf