Abstract
We study the algorithmic complexity of supporting late binding in dynamic object-oriented programming (OOP) languages—i.e., languages that allow creation of new class definitions at runtime. We propose an abstraction of the late-binding problem for dynamic OOP languages in terms of operations on dynamic trees, and develop a lower bound of Ω(lg n) per operation (where n is the number of nodes in the tree). This result shows that efficient solutions (i.e., solutions that incur a constant time overhead per operation) of this problem are, in general, not possible. We also propose new data-structures and algorithms for solving the late-binding problem for dynamic OOP languages very efficiently, with a worst-case time complexity of \(O\left( {\sqrt[3]{n}} \right)\) per operation. This result is an improvement over most existing approaches.
This work has been partially supported by NSF grants HRD 93-53271, INT 95-15256, and CCR 96-25358, and by NATO Grant CRG 921318.
Preview
Unable to display preview. Download preview PDF.
References
E. Amiel, O. Gruber, and E. Simon. Optimizing Multi-method Dispatch using Compressed Dispatch Tables. In Conf. on Object-Oriented Programming Systems, Languages, and Applications. ACM Press, 1994.
G. Blaschek. Object Oriented Programming with Prototypes. Springer Verlag, 1994.
N. Blum. On the single-operation worst-case time complexity of the disjoint set union problem. SIAM Journal on Computing, 15(4), 1986.
A. Borning. Classes versus Prototypes in Object Oriented Languages. In Fall Joint Computer Conference. ACM/IEEE, 1986.
D. Ungar C. Chambers and E. Lee. An Efficient Implementation of SELF. In OOPSLA. ACM, 1989.
W.R. Cook. A Denotational Semantics of Inheritance. PhD thesis, Brown University, 1989.
W.R. Cook and J. Palsberg. A Denotational Semantics of Inheritance and its Correctness. In Proc. OOPSLA. ACM, 1989.
P. Deutch and A. Schiffman. Efficient Implementation of the Smalltalk-80 System. In Proceedings POPL. ACM Press, 1984.
K. Driesen. Selector Table Indexing and Sparse Arrays. In Proceedings OOPSLA. ACM Press, 1993.
K. Driesen and U. Holzle. Minimizing Row Displacement Dispatch Tables. In Conf. on OO Progr. Systems, Lang., and Applications. ACM Press, 1995.
K. Driesen and U. Holzle. The Direct Cost of Virtual Function Calls in C++. In Conf. on Object Oriented Programming Systems, Languages, and Applications. ACM Press, 1996.
H.N. Gabow. Data structures for weighted matching and nearest common ancestor. In ACM Symp. on Discrete Algorithms, 1990.
A. Goldberg and D. Robson. Smalltalk-80: the Language and its Implementation. Addison-Wesley, 1983.
D. Harel and R.E. Tarjan. Fast Algorithms for Finding Nearest Common Ancestor. SIAM Journal of Computing, 13(2), 1984.
U. Holzle, C. Chambers, and D. Ungar. Optimizing Dynamically-typed Object-Oriented Languages with Polymorphic Inline Caches. In Proceedings ECOOP. Springer Verlag, 1991.
U. Holzle and D. Ungar. A Third Generation SELF Implementation. In Conf. on Object Oriented Progr. Systems, Languages, and Applications. ACM Press, 1994.
S.E. Keene. Object-oriented Programming in Common Lisp. Addison Wesley, 1988.
D.E. Knuth. The Art of Computer Programming, volume 1. Addison-Wesley, 1968.
A.N. Kolmogorov and V.A. Uspenskii. On the Definition of an Algorithm. Uspehi Mat. Nauk, 13, 1958.
E. Pontelli, D. Ranjan, and G. Gupta. Late-binding in Dynamic Object Oriented Systems. Technical Report, New Mexico State Univ., 1998.
E. Pontelli, D. Ranjan, and G. Gupta. On the Complexity of Parallel Implementation of Logic Programs. In Procs Int. Conf. on Foundations of Software Technology and Theoretical Computer Science. Springer Verlag, 1997.
H. La Poutré. Lower Bounds for the Union-Find and the Split-Find Problem on Pointer Machines. Journal of Computer and System Sciences, 52:87–99, 1996.
G. Ramalingam and H. Srinivasan. A Member Lookup Algorithm for C++. In Programming Languages Design and Implementation. ACM Press, 1997.
D. Ranjan, E. Pontelli, and G. Gupta. Dynamic Data Structures in Advanced Programming Languages Implementation, Technical report, Dept. Computer Science, New Mexico State University, 1997.
J.G. Rossie and D.P. Friedman. An Algebraic Semantics of Subobjects. In Conf. on Object-Oriented Progr. Systems, Languages, and Applications. ACM Press, 1995.
J.H. Saunders. A Survey of Object-Oriented Programming Languages. Journal of Object-Oriented Programming, 1(6), 1989.
A. Schönhage. Storage Modification Machines. SIAM Journal of Computing, 9(3):490–508, August 1980.
D.D. Sleator and R.E. Tarjan. A data structure for dynamic trees. Journal of Computer and System Sciences, 26, 1983.
L. Stein. Delegation is Inheritance. In OOPSLA. ACM, 1987.
A. Taivalsaari. On the Notion of Inheritance. Computing Surveys, 28(3), 1996.
R.E. Tarjan. A Class of Algorithms which Require Nonlinear Time to Mantain Disjoint Sets. Journal of Computer and System Sciences, 2(18), 1979.
A.K. Tsakalidis. The Nearest Common Ancestor in a Dynamic Tree. ACTA Informatica, 25, 1988.
J. Vitek, R. Nigel Horspool, and A. Krall. Efficient Type Inclusion Tests. In Conf. on Object-Oriented Programming Systems, Languages, and Applications. ACM Press, 1997.
P. Wegner. Concepts and Paradigms of Object-Oriented Programming. OOPS Messenger, 1(1), 1990.
O. Zendra, D. Colnet, and S. Collin. Efficient Dynamic Dispatch without Virtual Function Tables. In Conf. on Object Oriented Programming Systems, Languages, and Applications. ACM Press, 1997.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Pontelli, E., Ranjan, D., Gupta, G. (1998). The complexity of late-binding in dynamic object-oriented languages. In: Palamidessi, C., Glaser, H., Meinke, K. (eds) Principles of Declarative Programming. ALP PLILP 1998 1998. Lecture Notes in Computer Science, vol 1490. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0056616
Download citation
DOI: https://doi.org/10.1007/BFb0056616
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-65012-6
Online ISBN: 978-3-540-49766-0
eBook Packages: Springer Book Archive