ABSTRACT
Truffle is a Java-based framework for developing high-performance language runtimes. Language implementers aiming at developing new runtimes have to design all the runtime mechanisms for managing dynamically typed objects from scratch. This not only leads to potential code duplication, but also impacts the actual time needed to develop a fully-fledged runtime.
In this paper we address this issue by introducing a common object storage model (OSM) for Truffle that can be used by language implementers to develop new runtimes. The OSM is generic, language-agnostic, and portable, as it can be used to implement a great variety of dynamic languages. It is extensible, featuring built-in support for custom extension mechanisms. It is also high-performance, as it is designed to benefit from the optimizing compiler in the Truffle framework. Our initial evaluation indicates that the Truffle OSM can be used to implement high-performance language runtimes, with no performance overhead when compared to language-specific solutions.
- J. Castanos, D. Edelsohn, K. Ishizaki, P. Nagpurkar, T. Nakatani, T. Ogasawara, and P. Wu. On the benefits and pitfalls of extending a statically typed language JIT compiler for dynamic scripting languages. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications, pages 195--212, 2012. Google ScholarDigital Library
- C. Chambers, D. Ungar, and E. Lee. An efficient implementation of SELF, a dynamically-typed object-oriented language based on prototypes. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 49--70. ACM Press, 1989. Google ScholarDigital Library
- D. Chisnall. Smalltalk in a C world. In Proceedings of the International Workshop on Smalltalk Technologies, pages 4:1--4:12, 2012. Google ScholarDigital Library
- D. Chisnall. The challenge of cross-language interoperability. Queue, 11(10):20:20--20:28, Oct. 2013. Google ScholarDigital Library
- G. Duboscq, T. Würthinger, L. Stadler, C. Wimmer, D. Simon, and H. Mössenböck. An intermediate representation for speculative optimizations in a dynamic compiler. 2013.Google ScholarDigital Library
- ECMA International. Standard ECMA-262 - ECMAScript Language Specification. 5.1 edition, June 2011.Google Scholar
- N. Geoffray, G. Thomas, J. Lawall, G. Muller, and B. Folliot. VMKit: A substrate for managed runtime environments. In Proceedings of the International Conference on Virtual Execution Environments, pages 51--62, 2010. Google ScholarDigital Library
- Google. Octane benchmark suite, 2014. URL https://developers.google.com/octane/.Google Scholar
- Google. V8 JavaScript engine, 2014. URL http://code.google.com/p/v8/.Google Scholar
- J. Gosling, B. Joy, G. Steele, and G. Bracha. Java Language Specification, Third Edition. Addison-Wesley Professional, 2005. Google ScholarDigital Library
- M. Grimmer, T. Würthinger, A. Wöß, and H. Mössenböck. An efficient approach for accessing C data structures from JavaScript. In Proceedings of the Workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems. ACM Press, 2014. Google ScholarDigital Library
- U. Hölzle, C. Chambers, and D. Ungar. Optimizing dynamically-typed object-oriented languages with polymorphic inline caches. In Proceedings of the European Conference on Object-Oriented Programming, pages 21--38. Springer-Verlag, 1991. Google ScholarDigital Library
- U. Hölzle, C. Chambers, and D. Ungar. Debugging optimized code with dynamic deoptimization. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 32--43. ACM Press, 1992. Google ScholarDigital Library
- K. Ishizaki, T. Ogasawara, J. Castanos, P. Nagpurkar, D. Edelsohn, and T. Nakatani. Adding dynamically-typed language support to a statically-typed language compiler: Performance evaluation, analysis, and tradeoffs. In Proceedings of the International Conference on Virtual Execution Environments, pages 169--180, 2012. Google ScholarDigital Library
- J. Manson, W. Pugh, and S. V. Adve. The Java memory model. In Proceedings of the ACM SIGPLAN Symposium on Principles of Programming Languages, pages 378--391, 2005. Google ScholarDigital Library
- E. Meijer and J. Gough. Technical Overview of the Common Language Runtime. Technical report, 2000.Google Scholar
- Mozilla Foundation. Spidermonkey JavaScript engine, 2014. URL http://developer.mozilla.org/en/SpiderMonkey.Google Scholar
- OpenJDK Community. Graal project, 2014. URL http://openjdk.java.net/projects/graal/.Google Scholar
- OpenJDK Community. Nashorn project, 2014. URL http://openjdk.java.net/projects/nashorn/.Google Scholar
- G. Richards, S. Lebresne, B. Burg, and J. Vitek. An analysis of the dynamic behavior of JavaScript programs. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 1--12. ACM Press, 2010. Google ScholarDigital Library
- L. Stadler, T. Würthinger, and H. Mössenböck. Partial escape analysis and scalar replacement for Java. In Proceedings of the International Symposium on Code Generation and Optimization, pages 165--174. ACM Press, 2014. Google ScholarDigital Library
- D. Ungar and R. B. Smith. Self: The power of simplicity. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages, and Applications, pages 227--242, 1987. Google ScholarDigital Library
- T. Van Cutsem and M. S. Miller. Proxies: Design principles for robust object-oriented intercession APIs. In Proceedings of the Dynamic Languages Symposium, pages 59--72, 2010. Google ScholarDigital Library
- T. Würthinger, A. Wöß, L. Stadler, G. Duboscq, D. Simon, and C. Wimmer. Self-optimizing AST interpreters. In Proceedings of the Dynamic Languages Symposium, 2012. Google ScholarDigital Library
- T. W ürthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proceedings of Onward!, 2013. Google ScholarDigital Library
Index Terms
- An object storage model for the truffle language implementation framework
Recommendations
High-performance cross-language interoperability in a multi-language runtime
DLS 2015: Proceedings of the 11th Symposium on Dynamic LanguagesProgrammers combine different programming languages because it allows them to use the most suitable language for a given problem, to gradually migrate existing projects from one language to another, or to reuse existing source code. However, existing ...
Practical partial evaluation for high-performance dynamic language runtimes
PLDI 2017: Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and ImplementationMost high-performance dynamic language virtual machines duplicate language semantics in the interpreter, compiler, and runtime system. This violates the principle to not repeat yourself. In contrast, we define languages solely by writing an ...
Self-optimizing AST interpreters
DLS '12: Proceedings of the 8th symposium on Dynamic languagesAn abstract syntax tree (AST) interpreter is a simple and natural way to implement a programming language. However, it is also considered the slowest approach because of the high overhead of virtual method dispatch. Language implementers therefore ...
Comments