@InProceedings{shao95:_type_compil_stand_ml, author = {Zhong Shao and Andrew W. Appel}, title = {A Type-based Compiler for Standard ML}, booktitle = {Proc. 1995 ACM SIGPLAN Conference on Programming Language Design and Implementation}, pages = {116-129}, year = 1995, address = {La Jolla, CA}, month = {Jun}, abstract = {Compile-time type information should be valuable in efficient compilation of statically typed functional languages such as Standard ML. But how should type-directed compilation work in real compilers, and how much performance gain will type-based optimizations yield? In order to support more efficient data representations and gain more experience about type-directed compilation, we have implemented a new type-based middle end and back end for the Standard ML of New Jersey compiler. We describe the basic design of the new compiler, identify a number of practical issues, and then compare the performance of our new compiler with the old non-type-based compiler. Our measurement shows that a combination of several simple type-based optimizations reduces heap allocation by 36\%; and improves the already-efficient code generated by the old non-type-based compiler by about 19\% on a DECstation 5000.} }