Binding-Time Analysis for Both Static and Dynamic Expressions
This paper presents a specializer and a binding-time analyzer for a functional language where expressions are allowed to be used as both static and dynamic. With both static and dynamic expressions, we can statically access data structures while residualizing them at the same time. Previously, such data structures were treated as completely dynamic, which prevented us from accessing their components statically. The technique presented in this paper effectively allows us to lift data structures which was prohibited in the conventional partial evaluators. The binding-time analysis is formalized as a type system and the solution is obtained by solving constraints generated by the type system. We prove the correctness of the constraint solving algorithm and show that the algorithm runs efficiently in almost linear time.
Unable to display preview. Download preview PDF.
- 1.Asai, K., H. Masuhara, and A. Yonezawa “Partial Evaluation of Call-by-value λ-calculus with Side-effects,” ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’ 97), pp. 12–21 (June 1997).Google Scholar
- 5.Danvy, O. “Type-Directed Partial Evaluation,” Conference Record of the 23rd Annual ACM Symposium on Principles of Programming Languages, pp. 242–257 (January 1996).Google Scholar
- 6.Danvy, O., and A. Filinski “Abstracting Control,” Proceedings of the 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160 (June 1990).Google Scholar
- 8.Dean, J., C. Chambers, and D. Grove “Identifying Profitable Specialization in Object-Oriented Languages,” ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation (PEPM’ 94), pp. 85–96 (June 1994).Google Scholar
- 9.Fujinami, N. “Determination of Dynamic Method Dispatches Using Run-time Code Generation,” Proceedings of the Second International Workshop on Types in Compilation (TIC 1998), pp. 135–151 (March 1998).Google Scholar
- 10.Futamura, Y. “Partial evaluation of computation process–an approach to a compiler-compiler,” Systems, Computers, Controls, Vol. 2,No. 5, pp. 45–50, (1971).Google Scholar
- 12.Henglein, F. “Efficient Type Inference for Higher-Order Binding-Time Analysis,” In J. Hughes, editor, Functional Programming Languages and Computer Architecture (LNCS 523), pp. 448–472 (August 1991).Google Scholar
- 15.Ruf, E. Topics in Online Partial Evaluation, Ph.D. thesis, Stanford University (March 1993). Also published as Stanford Computer Systems Laboratory technical report CSL-TR-93-563.Google Scholar
- 16.Sperber, M. “Self-Applicable Online Partial Evaluation,” In O. Danvy, R. Glück, and P. Thiemann editors, Partial Evaluation (LNCS 1110), pp. 465–480 (February 1996).Google Scholar
- 18.Tarjan, R. Data Structures and Network Flow Algorithms, Volume CMBS 44 of Regional Conference Series in Applied Mathematics, SIAM (1983).Google Scholar