Abstract
In statically typed languages the set of classes and similar classifiers is commonly fully determined at compile time. Complete classifier representations can then be loaded at run-time, e.g., from a an executable file or a class file. However, some typing constructs—such as virtual classes—enable a type safe treatment of classifiers and their associated types and instances, even in the case where classifiers are created dynamically. This opens the opportunity to make dynamic class computations available as an integrated part of the language semantics. The language gbeta is an example where this is achieved based on mixins and linearization. In this paper we focus on the virtual machine related challenges of supporting dynamic class composition. In particular we present some core algorithms used for creating new classes, as well as some performance enhancements in these algorithms.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Augustsson, L.: Cayenne - a language with dependent types. In: ICFP, pp. 239–250 (1998)
Barrett, K., Cassels, B., Haahr, P., Moon, D.A., Playford, K., Withington, P.T.: A monotonic superclass linearization for dylan. In: Conference on Object-Oriented, pp. 69–82 (1996)
Betarte, G.: Dependent Record Types and Algebraic Structures in Type Theory. Phd thesis, Dept. of Computing Science, Chalmers Univ. of Technology and Univ. of Göteborg (1998)
Bracha, G.: Executable grammars in newspeak. Electron. Notes Theor. Comput. Sci. 193, 3–18 (2007)
Bracha, G., Cook, W.: Mixin-based inheritance. In: Proceedings OOPSLA/ECOOP 1990, ACM SIGPLAN Notices, vol. 25(10), pp. 303–311 (October 1990)
Deutsch, L.P., Schiffman, A.M.: Efficient implementation of the Smalltalk-80 system. In: Conference Record of the Eleventh Annual ACM Symposium on Principles of Programming Languages, Salt Lake City, Utah, pp. 297–302 (1984)
Ducournau, R., Habib, M., Mugnier, M.L., Huchard, M.: Proposal for a Monotonic Multiple Inheritance Linearization. In: ACM SIGPLAN Notices, Oregon, USA, vol. 29(10), pp. 164–175 (October 1994)
Ernst, E.: Higher-order hierarchies. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 303–329. Springer, Heidelberg (2003)
Ernst, E.: gbeta – a Language with Virtual Attributes, Block Structure, and Propagating, Dynamic Inheritance. PhD thesis, Department of Computer Science, University of Aarhus, Århus, Denmark (1999)
Ernst, E.: Propagating class and method combination. In: Guerraoui, R. (ed.) ECOOP 1999. LNCS, vol. 1628. Springer, Heidelberg (1999)
Ernst, E.: Family polymorphism. In: Knudsen, J.L. (ed.) ECOOP 2001. LNCS, vol. 2072, pp. 303–326. Springer, Heidelberg (2001)
Ernst, E.: Reconciling virtual classes with genericity. In: Lightfoot, D.E., Szyperski, C.A. (eds.) JMLC 2006. LNCS, vol. 4228, pp. 57–72. Springer, Heidelberg (2006)
Ernst, E., Ostermann, K., Cook, W.R.: A virtual class calculus. In: POPL 2006: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 270–282. ACM Press, New York (2006)
Goldberg, A., Robson, D.: Smalltalk–80: The Language. Addison-Wesley, Reading (1989)
Hlzle, U., Chambers, C., Ungar, D.: Optimizing dynamically-typed object-oriented languages with polymorphic inline caches (1991)
Madsen, O.L., Møller-Pedersen, B.: Virtual classes: A powerful mechanism in object-oriented programming. In: Proceedings OOPSLA 1989, ACM SIGPLAN Notices, vol. 24(10), pp. 397–406 (October 1989)
Madsen, O.L., Nygaard, K., Møller-Pedersen, B.: Object-Oriented Programming in The Beta Programming Language. Addison-Wesley (1993)
Mezini, M., Ostermann, K.: Conquering aspects with caesar. In: AOSD 2003: Proceedings of the 2nd international conference on Aspect-oriented software development, pp. 90–99. ACM Press, New York (2003)
Mitchell, J.C., Plotkin, G.D.: Abstract types have existential types. In: Conference Record of the Twelfth Annual ACM Symposium on Principles of Programming Languages, pp. 37–51. ACM (January 1985)
Nystrom, N., Qi, X., Myers, A.C.: J&: nested intersection for scalable software composition. In: OOPSLA 2006: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applications, pp. 21–36. ACM, New York (2006)
Odersky, M., Cremet, V., Röckl, C., Zenger, M.: A nominal theory of objects with dependent types. In: Cardelli, L. (ed.) ECOOP 2003. LNCS, vol. 2743, pp. 201–224. Springer, Heidelberg (2003)
Ungar, D., Smith, R.B.: Self: The power of simplicity. In: Proceedings OOPSLA 1987, Orlando, FL, pp. 227–242 (October 1987)
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Nielsen, A.B., Ernst, E. (2008). Optimizing Dynamic Class Composition in a Statically Typed Language. In: Paige, R.F., Meyer, B. (eds) Objects, Components, Models and Patterns. TOOLS EUROPE 2008. Lecture Notes in Business Information Processing, vol 11. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-69824-1_10
Download citation
DOI: https://doi.org/10.1007/978-3-540-69824-1_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-69823-4
Online ISBN: 978-3-540-69824-1
eBook Packages: Computer ScienceComputer Science (R0)