Unify and conquer
- 1 May 1990
- proceedings article
- Published by Association for Computing Machinery (ACM)
- p. 218-226
- https://doi.org/10.1145/91556.91652
Abstract
Type inference is the process by which an expression in an untyped computer language such as the lambda-calculus, Lisp, or a functional language can be assigned a static data type in order to improve the code generated by a compiler. Storage use inference is the process by which a program in a computer language can be statically analyzed to model its run-time behavior, particularly the containment and sharing relations among its run-time data structures. The information generated by storage use information can also be used to improve the code generated by a compiler, because knowledge of the containment and sharing relations of run-time data structures allows for methods of storage allocation and deallocation which are cheaper than garbage-collected heap storage and allows for the in-place updating of functional aggregates.Type inference and storage use inference have traditionally been considered orthogonal processes, with separate traditions and literature. However, we show in this paper than this separation may be a mistake, because the best-known and best-understood of the type inferencing algorithms—Milner's unification method for ML—already generates valuable sharing and containment information which is then unfortunately discarded. We show that this sharing information is already generated by standard unification algorithms with no additional overhead during unification; however, there is some additional work necessary to extract this information. We have not yet precisely characterized the resolving power of this sharing and containment information, but we believe that it is similar to that generated by researchers using other techniques. However, our scheme seems to only work for functional languages like pure Lisp.The unification of type and storage inferencing yields new insights into the meaning of “aggregate type”, which should prove valuable in the design of future type systems.Keywords
This publication has 25 references indexed in Scilit:
- Dependence analysis for pointer variablesACM SIGPLAN Notices, 1989
- Update analysis and the efficient implementation of functional aggregatesPublished by Association for Computing Machinery (ACM) ,1989
- Analysis of functional programs to detect run-time garbage cellsACM Transactions on Programming Languages and Systems, 1988
- Lifetime analysis of dynamically allocated objectsPublished by Association for Computing Machinery (ACM) ,1988
- Implementing RUSSELLACM SIGPLAN Notices, 1986
- A real-time garbage collector based on the lifetimes of objectsCommunications of the ACM, 1983
- Rationale for the design of the Ada programming languageACM SIGPLAN Notices, 1979
- A theory of type polymorphism in programmingJournal of Computer and System Sciences, 1978
- List processing in real time on a serial computerCommunications of the ACM, 1978
- Shifting garbage collection overhead to compile timeCommunications of the ACM, 1977