Title
A standard ML compiler
Abstract
Standard ML is a major revision of earlier dialects of the functional language ML. We describe the first compiler written for Standard ML in Standard ML. The compiler incorporates a number of novel features and techniques, and is probably the largest system written to date in Standard ML. Great attention was paid to modularity in the construction of the compiler, lead- ing to a successful large-scale test of the modular capabilities of Standard ML. The front end is useful for purposes other than compilation, and the back end is easily retargetable (we have code generators for the VAX and MC68020). The module facilities of Standard ML were taken into account early in the design of the compiler, and they particularly influenced the environment management component of the front end. For example, the symbol table structure is designed for fast access to opened structures. The front end of the compiler is a single phase that integrates parsing, environ- ment management, and type checking. The middle end uses a sophisticated deci- sion tree scheme to produce efficient pattern matching code for functions and case expressions. The abstract syntax produced by the front end is translated into a simple lambda-calculus-based intermediate representation that lends itself to easy case analysis and optimization in the code generator. Special care was taken in designing the runtime data structures for fast allocation and garbage col- lection. We describe the overall organization of the compiler and present some of the data representations and algorithms used in its various phases. We conclude with some lessons learned about the ML language itself and about compilers for modern functional languages.
Year
DOI
Venue
1987
10.1007/3-540-18317-5_17
FPCA
Keywords
Field
DocType
standard ml compiler,code generation,col,intermediate representation,data representation,front end,data structure,functional language,abstract syntax,pattern matching,lambda calculus
Programming language,Functional programming,Standard ML,Computer science,Compiler,Code generation,Abstract syntax,Abstract machine,Runtime system
Conference
Volume
ISSN
ISBN
274
0302-9743
0-387-18317-5
Citations 
PageRank 
References 
67
24.80
16
Authors
2
Name
Order
Citations
PageRank
Andrew W. Appel12599292.71
David B. MacQueen2850229.37