Dynamic languages, such as JavaScript, Python, Lua and Ruby, are increasingly popular amongst programmers at large, and virtual machine technology is constantly evolving to keep pace. This seminar aims to show both the gritty details and the high-level ideas of implementing VM's for dynamic languages. It is being taught by Prof. Gregor Richards.

The course grade breakdown is: 30% projects, 30% presentation, 30% final, 10% quizzes.

Schedule

In January we will cover the state of the art through lectures and discussion, and in February and March we will explore future research through student-led presentations. The schedule of presentations and discussions will be posted here as it is developed.

DatePaper
Feb 2Typed Lua: An Optional Type System for Lua. Andre Murbach Maidl, Fabio Mascarenhas and Roberto Ierusalimschy. Dyla 2014.
Feb 4Portable and Efficient Run-time Monitoring of JavaScript Applications using Virtual Machine Layering. Erick Lavoie, Bruno Dufour and Marc Feeley. ECOOP 2013.
Feb 9List-based Monadic Computations for Dynamically Typed Languages. Wim Vanderbauwhede. Dyla 2014.
Feb 11Self-Optimizing AST Interpreters. Thomas Wuerthinger et al. DLS 2012.
Feb 23Surgical Precision JIT Compilers. Tiark Rompf et al. PLDI 2014.
Feb 25Abstracting Abstract Control. J. Ian Johnson and David Van Horn. DLS 2014 (SPLASH 2014).
Mar 2Towards Type Inference for JavaScript. Christopher Anderson, Paola Giannini and Sophia Drossopoulou. ECOOP 2005.
Mar 4The Impact of Optional Type Information on JIT Compilation of Dynamically Typed Languages. Mason Chang et al. DLS 2011 (SPLASH 2011).
Mar 9Printing Floating-Point Numbers Quickly and Accurately with Integers. Florian Loitsch. PLDI 2010.
Mar 11An overview of LuaJIT (no paper).
Mar 16Trace-based Just-in-Time Type Specialization for Dynamic Languages. Andreas Gal et al. PLDI 2009.
Mar 18An Intermediate Representation for Speculative Optimizations in a Dynamic Compiler. Gilles Duboscq et al. VMIL 2013.
Mar 23Static vs. Dynamic Type Systems: An Empirical Study About the Relationship Between Type Casts and Development Time. Andreas Stuchlik and Stefan Hanenberg. DLS 2011 (SPLASH 2011).
Mar 25Race Detection for Web Applications. Boris Petrov et al. PLDI 2012.
Mar 30Call Sequence Prediction through Probabilistic Calling Automata. Zhijia Zhao et al. OOPSLA 2014 (SPLASH 2014).
Apr 1Tracing the Meta-Level: PyPy's Tracing JIT Compiler. Carl Friedrich Bolz et al. ICOOOLPS 2009 (ECOOP 2009).

Projects

This course has two software implementation projects, accounting collectively for 30% of the grade.

Project 1: Inline caching

The first project is to implement inline caching, as discussed in class, in SDyn. A patch, sdyn-1.1-inline-cache-scaffolding.diff.gz, which adds the scaffolding to implement inline caching. Alternatively you may download sdyn-1.1-w-inline-cache-scaffolding.tar.gz, which is sdyn 1.1 with the patch preapplied.

For each cacheable access site, the JIT creates a SDyn_InlineCache object. An SDyn_InlineCache* is passed to each function which accesses members of objects. You must define SDyn_InlineCache in h/sdyn/value.h , and use it in the relevant functions in value.c to implement caching of object shapes. Submit completed projects as tarballs to the instructor by email by 23 February, 11:59PM.

Resources

This list of suggested papers is here.

To explore “the gritty details”, this course will use a simple dynamic language implementation called SDyn. As a JIT, SDyn is not intrinsically portable: At present, it works on x86_64 Unix only. Slightly specialized versions of SDyn will be provided for the projects. SDyn is available here.