Abstract
Programming languages are still evolving, and programming languages and language features are being designed and implemented every year. Since it is not a trivial task to provide a runtime system for a new language, existing runtime systems such as the Java Virtual Machine or the Common Language Runtime are used to host the new language.
However, most of the high-performance runtime systems were designed for a specific language with a specific semantics. Therefore, if the new language semantics differs from the semantics hard-coded in a runtime system, it has to be emulated on top of features supported by the runtime.
The emulation causes performance overhead.
To overcome the limitations of an emulation, a runtime system may provide a meta-object protocol to alter the runtime semantics. The protocol should fulfill opposing goals: it should be flexible, easy to use, fast and easy to implement at the same time.
We propose a simple meta-object protocol for customization of a method lookup in Smalltalk. A programmer may define his own custom method lookup routine in Smalltalk and let the runtime system to call it when needed. Therefore there is no need to modify the runtime system itself. Our solution provides reasonable performance thanks to low-level support in a runtime system, nevertheless the changes to the runtime system are small and local. At the same time, it provides the flexibility to implement a wide range of features present in modern programming languages.
The presented approach has been implemented and validated on a Smalltalk virtual machine.
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
Smalltalk/X (August 2010), http://www.exept.de/en/products/smalltalk-x/stx-overview
Bergel, A., Ducasse, S., Nierstrasz, O., Wuyts, R.: Classboxes: Controlling visibility of class extensions. Computer Languages, Systems and Structures 31(3-4), 107–126 (2005)
Bracha, G., Cook, W.: Mixin-based inheritance. In: Proceedings OOPSLA/ECOOP 1990. ACM SIGPLAN Notices, vol. 25, pp. 303–311 (October 1990)
Chiles, B., Turner, A.: Dynamic Language Runtime (August 2010), http://dlr.codeplex.com/wikipage?title=Docs%20and%20specs
Peter Deutsch, L., Schiffman, A.M.: Efficient implementation of the Smalltalk-80 system. In: Proceedings POPL 1984, Salt Lake City, Utah (January 1984)
Gittinger, C.: Smalltalk/X Programmers Reference Manual - Smalltalk Performance Myths and Facts, http://live.exept.de/doc/online/english/programming/STspeed.html
Hölzle, U., Chambers, C., Ungar, D.: Optimizing Dynamically-typed Object-oriented Languages with Polymorphic Inline Caches. In: America, P. (ed.) ECOOP 1991. LNCS, vol. 512, pp. 21–38. Springer, Heidelberg (1991)
JSR-000292 Supporting Dynamically Typed Languages on the Java Platform (August 2010), http://jcp.org/aboutJava/communityprocess/edr/jsr292/index.html
Kiczales, G., des Rivières, J., Bobrow, D.G.: The Art of the Metaobject Protocol. MIT Press (1991)
Lawless, J.A., Milner, M.M.: Understanding Clos the Common Lisp Object System. Digital Press (1989)
Rose, J.R.: Bytecodes meet combinators: Invokedynamic on the jvm. In: VMIL 2009: Proceedings of the Third Workshop on Virtual Machines and Intermediate Languages, pp. 1–11. ACM, New York (2009)
Tolksdorf, R.: Programming languages for the java virtual machine (August 2010), http://www.is-research.de/info/vmlanguages/
Ungar, D.M.: The Design and Evaluation of A High Performance Smalltalk System. PhD thesis, EECS Department, University of California, Berkeley (February 1986)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Vraný, J., Kurš, J., Gittinger, C. (2012). Efficient Method Lookup Customization for Smalltalk. In: Furia, C.A., Nanz, S. (eds) Objects, Models, Components, Patterns. TOOLS 2012. Lecture Notes in Computer Science, vol 7304. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-30561-0_10
Download citation
DOI: https://doi.org/10.1007/978-3-642-30561-0_10
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-30560-3
Online ISBN: 978-3-642-30561-0
eBook Packages: Computer ScienceComputer Science (R0)