Abstract
Many compilers do some of their work by means of correctness-preserving, and hopefully performance-improving, program transformations. The Glasgow Haskell Compiler (GHC) takes this idea of “compilation by transformation” as its war-cry, trying to express as much as possible of the compilation process in the form of program transformations.
This paper reports on our practical experience of the transformational approach to compilation, in the context of a substantial compiler.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
AV Aho, R Sethi & JD Ullman [1986], Compilers — principles, techniques and tools, Addison Wesley.
AW Appel [1992], Compiling with continuations, Cambridge University Press.
AW Appel & T Jim [1996], “Shrinking Lambda-Expressions in Linear Time,” Department of Computer Science, Princeton University.
Z Ariola, M Felleisen, J Maraist, M Odersky & P Wadler [Jan 1995], “A call by need lambda calculus,” in 22nd ACM Symposium on Principles of Programming Languages, San Francisco, ACM, 233–246.
L Augustsson [1987], “Compiling lazy functional languages, part II,” PhD thesis, Dept Comp Sci, Chalmers University, Sweden.
DF Bacon, SL Graham & OJ Sharp [Dec 1994], “Compiler transformations for high-performance computing,” ACM Computing Surveys 26, 345–420.
B Calder, D Grunwald & B Zorn [Dec 1994], “Quantifying behavioural differences between C and C++ programs,” Journal of Programming Languages 2, 313–351.
C Chambers, J Dean & D Grove [Apr 1995], “A framework for selective recompilation in the presence of complex intermodule dependencies,” in Proc International Conference on Software Engineering, Seattle.
JW Davidson & AM Holler [1988], “A study of a C function inliner,” Software — Practice and Experience 18, 775–790.
C Flanagan, A Sabry, B Duba & M Felleisen [June 1993], “The essence of compiling with continuations,” SIGPLAN Notices 28, 237–247.
P Fradet & D Le Metayer [Jan 1991], “Compilation of functional languages by program transformation,” ACM Transactions on Programming Languages and Systems 13, 21–51.
A Gill, J Launchbury & SL Peyton Jones [June 1993], “A short cut to deforestation,” in Proc Functional Programming Languages and Computer Architecture, Copenhagen, ACM, 223–232.
AJ Gill [Jan 1996], “Cheap deforestation for non-strict functional languages,” PhD thesis, Department of Computing Science, Glasgow University.
J Girard [1971], “Une extension de l'interpretation de Gödel a l'analyse, et son application a l'elimination de coupures dans l'analyse et la theorie des types,” in 2nd Scandinavian Logic Symposium, JE Fenstad, ed., North Holland, 63–92.
R Harper & G Morrisett [Jan 1995], “Compiling polymorphism using intensional type analysis,” in 22nd ACM Symposium on Principles of Programming Languages, San Francisco, ACM, 130–141.
P Hudak, SL Peyton Jones, PL Wadler, Arvind, B Boutel, J Fairbairn, J Fasel, M Guzman, K Hammond, J Hughes, T Johnsson, R Kieburtz, RS Nikhil, W Partain & J Peterson [May 1992], “Report on the functional programming language Haskell, Version 1.2,” SIGPLAN Notices 27.
RJM Hughes [July 1983], “The design and implementation of programming languages,” PhD thesis, Programming Research Group, Oxford.
Thomas Johnsson [1985], “Lambda lifting: transforming programs to recursive equations,” in Proc IFIP Conference on Functional Programming and Computer Architecture, Jouannaud, ed., LNCS 201, Springer Verlag, 190–205.
R Kelsey [May 1989], “Compilation by program transformation,” YALEU/DCS/RR-702, PhD thesis, Department of Computer Science, Yale University.
R Kelsey & P Hudak [Jan 1989], “Realistic compilation by program transformation,” in Proc ACM Conference on Principles of Programming Languages, ACM, 281–292.
DA Kranz [May 1988], “ORBIT — an optimising compiler for Scheme,” PhD thesis, Department of Computer Science, Yale University.
DA Kranz, R Kelsey, J Rees, P Hudak, J Philbin & N Adams [1986], “ORBIT — an optimising compiler for Scheme,” in Proc SIGPLAN Symposium on Compiler Construction, ACM.
J Launchbury [Jan 1993], “A natural semantics for lazy evaluation,” in 20th ACM Symposium on Principles of Programming Languages, Charleston, ACM, 144–154.
J Launchbury & SL Peyton Jones [June 1994], “Lazy functional state threads,” in SIGPLAN Symposium on Programming Language Design and Implementation (PLDI'94), Orlando, ACM, 24–35.
S Marlow [March 1996], “Deforestation for Higher Order Functional Programs,” PhD thesis, Department of Computing Science, University of Glasgow.
R Morrison, A Dearle, RCH Connor & AL Brown [July 1991], “An ad hoc approach to the implementation of polymorphism,” ACM Transactions on Programming Languages and Systems 13, 342–371.
A Ohori [Jan 1992], “A compilation method for ML-style polymorphic record calculi,” in 19th ACM Symposium on Principles of Programming Languages, Albuquerque, ACM, 154–165.
WD Partain [1993], “The nofib Benchmark Suite of Haskell Programs,” in Functional Programming, Glasgow 1992, J Launchbury & PM Sansom, eds., Workshops in Computing, Springer Verlag, 195–202.
SL Peyton Jones [1987], The Implementation of Functional Programming Languages, Prentice Hall.
SL Peyton Jones [Apr 1992], “Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine,” Journal of Functional Programming 2, 127–202.
SL Peyton Jones, CV Hall, K Hammond, WD Partain & PL Wadler [March 1993], “The Glasgow Haskell compiler: a technical overview,” in Proceedings of Joint Framework for Information Technology Technical Conference, Keele, DTI/SERC, 249–257.
SL Peyton Jones & J Launchbury [Sept 1991], “Unboxed values as first class citizens,” in Functional Programming Languages and Computer Architecture, Boston, Hughes, ed., LNCS 523, Springer Verlag, 636–666.
SL Peyton Jones & D Lester [May 1991], “A modular fully-lazy lambda lifter in Haskell,” Software — Practice and Experience 21, 479–506.
SL Peyton Jones & WD Partain [1993], “Measuring the effectiveness of a simple strictness analyser,” in Functional Programming, Glasgow 1993, K Hammond & JT O'Donnell, eds., Workshops in Computing, Springer Verlag, 201–220.
SL Peyton Jones, WD Partain & A Santos [May 1996], “Let-floating: moving bindings to give faster programs,” in Proc International Conference on Functional Programming, Philadelphia, ACM.
SL Peyton Jones & A Santos [1994], “Compilation by transformation in the Glasgow Haskell Compiler,” in Functional Programming, Glasgow 1994, K Hammond, DN Turner & PM Sansom, eds., Workshops in Computing, Springer Verlag, 184–204.
SL Peyton Jones & PL Wadler [Jan 1993], “Imperative functional programming,” in 20th ACM Symposium on Principles of Programming Languages, Charleston, ACM, 71–84.
JC Reynolds [1974], “Towards a theory of type structure,” in International Programming Symposium, Springer Verlag LNCS 19, 408–425.
PM Sansom [Sept 1994], “Execution profiling for non-strict functional languages,” PhD thesis, Technical Report FP-1994-09, Department of Computer Science, University of Glasgow, (ftp://ftp.dcs.glasgow.ac.uk/pub/glasgow-fp/tech_reports/FP-94-09_execution-profiling.ps.Z).
PM Sansom & SL Peyton Jones [Jan 1995], “Time and space profiling for nonstrict, higher-order functional languages,” in 22nd ACM Symposium on Principles of Programming Languages, San Francisco, ACM, 355–366.
A Santos [Sept 1995], “Compilation by transformation in non-strict functional languages,” PhD thesis, Department of Computing Science, Glasgow University.
Z Shao & AW Appel [June 1995], “A type-based compiler for Standard ML,” in SIGPLAN Symposium on Programming Language Design and Implementation (PLDI'95), La Jolla, ACM, 116–129.
GL Steele [1978], “Rabbit: a compiler for Scheme,” AI-TR-474, MIT Lab for Computer Science.
A Tolmach [June 1994], “Tag-free garbage collection using explicit type parameters,” in ACM Symposium on Lisp and Functional Programming, Orlando, ACM, 1–11.
PL Wadler [1990], “Deforestation: transforming programs to eliminate trees,” Theoretical Computer Science 73, 231–248.
PL Wadler [Jan 1992], “The essence of functional programming,” in 19th ACM Symposium on Principles of Programming Languages, Albuquerque, ACM, 1–14.
PL Wadler & DN Turner [June 1995], “Once upon a type,” in Proc Functional Programming Languages and Computer Architecture, La Jolla, ACM, 1–11.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jones, S.L.P. (1996). Compiling Haskell by program transformation: A report from the trenches. In: Nielson, H.R. (eds) Programming Languages and Systems — ESOP '96. ESOP 1996. Lecture Notes in Computer Science, vol 1058. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61055-3_27
Download citation
DOI: https://doi.org/10.1007/3-540-61055-3_27
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61055-7
Online ISBN: 978-3-540-49942-8
eBook Packages: Springer Book Archive