ABSTRACT
Language implementation frameworks aim to provide everything that is needed to build interpreters, simplify the process by making certain design decisions in advance, and suggest implementation strategies to virtual machine creators. Truffle, the language implementation framework for the GraalVM, is designed for building Abstract Syntax Tree interpreters and the process of doing so is well documented. However, although less documented, Truffle can also be used to implement bytecode interpreters. This approach requires additional hints to be passed into the compiler to gain good performance.
In this paper, we compare two Truffle interpreters for Squeak/Smalltalk, one using an ast implementation approach and the other executing bytecodes. While both run at roughly three times the speed of the standard Squeak/Smalltalk virtual machine, both represent different trade-offs in implementation strategies for interpreters in Truffle. We compare these trade-offs and discuss the advantages and disadvantages of the different approaches.
- Davide Ancona, Massimo Ancona, Antonio Cuni, and Nicholas D. Matsakis. 2007. RPython: A Step Towards Reconciling Dynamically and Statically Typed OO Languages. In Proceedings of the 2007 Symposium on Dynamic Languages (DLS '07). ACM, New York, NY, USA, 53--64. Google ScholarDigital Library
- Clément Béra, Eliot Miranda, Tim Felgentreff, Marcus Denker, and Stéphane Ducasse. 2017. Sista: Saving Optimized Code in Snapshots for Fast Start-Up. In Proceedings of the 14th International Conference on Managed Languages and Runtimes (ManLang 2017). ACM, New York, NY, USA, 1--11. Google ScholarDigital Library
- Carl Friedrich Bolz, Adrian Kuhn, Adrian Lienhard, Nicholas D. Matsakis, Oscar Nierstrasz, Lukas Renggli, Armin Rigo, and Toon Verwaest. 2008. Back to the Future in One Week --- Implementing a Smalltalk VM in PyPy. Springer-Verlag, Berlin, Heidelberg, 123--139.Google Scholar
- Tim Felgentreff, Tobias Pape, Patrick Rein, and Robert Hirschfeld. 2016. How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: An Experience Report of Using the RPython Toolchain. In Proceedings of the 11th Edition of the International Workshop on Smalltalk Technologies (IWST '16). ACM, New York, NY, USA, Article 21, 10 pages. Google ScholarDigital Library
- Adele Goldberg and David Robson. 1983. Smalltalk-80: The Language and Its Implementation. Addison-Wesley Longman, Boston, MA, USA. The Blue Book. Google ScholarDigital Library
- Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace, and Alan Kay. 1997. Back to the Future: The Story of Squeak, a Practical Smalltalk Written in Itself. SIGPLAN Not. 32, 10 (10 1997), 318--326. Google ScholarDigital Library
- Stefan Marr, Carmen Torres Lopez, Dominik Aumayr, Elisa Gonzalez Boix, and Hanspeter Mössenböck. 2017. A Concurrency-Agnostic Protocol for Multi-Paradigm Concurrent Debugging Tools. In Proceedings of the 13th ACM SIGPLAN International Symposium on Dynamic Languages (DLS'17). ACM, 12. Google ScholarDigital Library
- Eliot Miranda and contributors. 2017. OpenSmalltalkVM. (2017). https://github.com/OpenSmalltalk/opensmalltalk-vmGoogle Scholar
- Manuel Rigger, Matthias Grimmer, Christian Wimmer, Thomas Würthinger, and Hanspeter Mössenböck. 2016. Bringing Low-level Languages to the JVM: Efficient Execution of LLVM IR on Truffle. In Proceedings of the 8th International Workshop on Virtual Machines and Intermediate Languages (VMIL 2016). ACM, New York, NY, USA, 6--15. Google ScholarDigital Library
- Armin Rigo and Samuele Pedroni. 2006. PyPy's approach to virtual machine construction. In Companion to the 21st ACM SIGPLAN symposium on Object-oriented programming systems, languages, and applications (OOPSLA '06). ACM, New York, NY, USA, 944--953. Google ScholarDigital Library
- Koichi Sasada. 2005. YARV: Yet Another RubyVM: Innovating the Ruby Interpreter. In Companion to the 20th Annual ACM SIGPLAN Conference on Object-oriented Programming, Systems, Languages, and Applications (OOPSLA '05). ACM, New York, NY, USA, 158--159. Google ScholarDigital Library
- Squeak/Smalltalk Community. 2018. FAQ: Speed. (2018). http://wiki.squeak.org/squeak/768Google Scholar
- Thomas Würthinger, Christian Wimmer, Christian Humer, Andreas Wöß, Lukas Stadler, Chris Seaton, Gilles Duboscq, Doug Simon, and Matthias Grimmer. 2017. Practical Partial Evaluation for High-performance Dynamic Language Runtimes. SIGPLAN Not. 52, 6 (June 2017), 662--676. Google ScholarDigital Library
- Thomas Würthinger, Christian Wimmer, Andreas Wöß, Lukas Stadler, Gilles Duboscq, Christian Humer, Gregor Richards, Doug Simon, and Mario Wolczko. 2013. One VM to Rule Them All. In Proceedings of the 2013 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software (Onward! 2013). ACM, New York, NY, USA, 187--204. Google ScholarDigital Library
Index Terms
- GraalSqueak: A Fast Smalltalk Bytecode Interpreter Written in an AST Interpreter Framework
Recommendations
GraalSqueak: toward a smalltalk-based tooling platform for polyglot programming
MPLR 2019: Proceedings of the 16th ACM SIGPLAN International Conference on Managed Programming Languages and RuntimesPolyglot programming provides software developers with a broader choice in terms of software libraries and frameworks available for building applications. Previous research and engineering activities have focused on language interoperability and the ...
Debugging native extensions of dynamic languages
ManLang '18: Proceedings of the 15th International Conference on Managed Languages & RuntimesMany dynamic programming languages such as Ruby and Python enable developers to use so called native extensions, code implemented in typically statically compiled languages like C and C++. However, debuggers for these dynamic languages usually lack ...
Efficient implementation of Smalltalk activation records in language implementation frameworks
Programming '19: Companion Proceedings of the 3rd International Conference on the Art, Science, and Engineering of ProgrammingLanguage implementation frameworks such as RPython or Truffle help to build runtimes for dynamic languages. For this, they make certain design decisions and trade-offs upfront to make common language concepts easy to implement. Because of this, however, ...
Comments