Skip to main content

The complexity of late-binding in dynamic object-oriented languages

  • Conference paper
  • First Online:
Principles of Declarative Programming (ALP 1998, PLILP 1998)

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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.

    Google Scholar 

  2. G. Blaschek. Object Oriented Programming with Prototypes. Springer Verlag, 1994.

    Google Scholar 

  3. N. Blum. On the single-operation worst-case time complexity of the disjoint set union problem. SIAM Journal on Computing, 15(4), 1986.

    Google Scholar 

  4. A. Borning. Classes versus Prototypes in Object Oriented Languages. In Fall Joint Computer Conference. ACM/IEEE, 1986.

    Google Scholar 

  5. D. Ungar C. Chambers and E. Lee. An Efficient Implementation of SELF. In OOPSLA. ACM, 1989.

    Google Scholar 

  6. W.R. Cook. A Denotational Semantics of Inheritance. PhD thesis, Brown University, 1989.

    Google Scholar 

  7. W.R. Cook and J. Palsberg. A Denotational Semantics of Inheritance and its Correctness. In Proc. OOPSLA. ACM, 1989.

    Google Scholar 

  8. P. Deutch and A. Schiffman. Efficient Implementation of the Smalltalk-80 System. In Proceedings POPL. ACM Press, 1984.

    Google Scholar 

  9. K. Driesen. Selector Table Indexing and Sparse Arrays. In Proceedings OOPSLA. ACM Press, 1993.

    Google Scholar 

  10. K. Driesen and U. Holzle. Minimizing Row Displacement Dispatch Tables. In Conf. on OO Progr. Systems, Lang., and Applications. ACM Press, 1995.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. H.N. Gabow. Data structures for weighted matching and nearest common ancestor. In ACM Symp. on Discrete Algorithms, 1990.

    Google Scholar 

  13. A. Goldberg and D. Robson. Smalltalk-80: the Language and its Implementation. Addison-Wesley, 1983.

    Google Scholar 

  14. D. Harel and R.E. Tarjan. Fast Algorithms for Finding Nearest Common Ancestor. SIAM Journal of Computing, 13(2), 1984.

    Google Scholar 

  15. U. Holzle, C. Chambers, and D. Ungar. Optimizing Dynamically-typed Object-Oriented Languages with Polymorphic Inline Caches. In Proceedings ECOOP. Springer Verlag, 1991.

    Google Scholar 

  16. U. Holzle and D. Ungar. A Third Generation SELF Implementation. In Conf. on Object Oriented Progr. Systems, Languages, and Applications. ACM Press, 1994.

    Google Scholar 

  17. S.E. Keene. Object-oriented Programming in Common Lisp. Addison Wesley, 1988.

    Google Scholar 

  18. D.E. Knuth. The Art of Computer Programming, volume 1. Addison-Wesley, 1968.

    Google Scholar 

  19. A.N. Kolmogorov and V.A. Uspenskii. On the Definition of an Algorithm. Uspehi Mat. Nauk, 13, 1958.

    Google Scholar 

  20. E. Pontelli, D. Ranjan, and G. Gupta. Late-binding in Dynamic Object Oriented Systems. Technical Report, New Mexico State Univ., 1998.

    Google Scholar 

  21. 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.

    Google Scholar 

  22. 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.

    Article  MATH  MathSciNet  Google Scholar 

  23. G. Ramalingam and H. Srinivasan. A Member Lookup Algorithm for C++. In Programming Languages Design and Implementation. ACM Press, 1997.

    Google Scholar 

  24. 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.

    Google Scholar 

  25. 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.

    Google Scholar 

  26. J.H. Saunders. A Survey of Object-Oriented Programming Languages. Journal of Object-Oriented Programming, 1(6), 1989.

    Google Scholar 

  27. A. Schönhage. Storage Modification Machines. SIAM Journal of Computing, 9(3):490–508, August 1980.

    Article  MATH  Google Scholar 

  28. D.D. Sleator and R.E. Tarjan. A data structure for dynamic trees. Journal of Computer and System Sciences, 26, 1983.

    Google Scholar 

  29. L. Stein. Delegation is Inheritance. In OOPSLA. ACM, 1987.

    Google Scholar 

  30. A. Taivalsaari. On the Notion of Inheritance. Computing Surveys, 28(3), 1996.

    Google Scholar 

  31. R.E. Tarjan. A Class of Algorithms which Require Nonlinear Time to Mantain Disjoint Sets. Journal of Computer and System Sciences, 2(18), 1979.

    Google Scholar 

  32. A.K. Tsakalidis. The Nearest Common Ancestor in a Dynamic Tree. ACTA Informatica, 25, 1988.

    Google Scholar 

  33. 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.

    Google Scholar 

  34. P. Wegner. Concepts and Paradigms of Object-Oriented Programming. OOPS Messenger, 1(1), 1990.

    Google Scholar 

  35. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Catuscia Palamidessi Hugh Glaser Karl Meinke

Rights and permissions

Reprints 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

Publish with us

Policies and ethics