Mark Shannon

I am a research student at the University of Glasgow. My research is focussed on the engineering behind virtual machines for dynamic languages such as Python. These virtual machines are large and complex, and the conventional tools for building these machines, such as C compilers, are inadequate.

Research --- Building Virtual Machines for Dynamic Languages

Virtual machines consist of many complex, interacting and interwoven parts. Object-oriented languages and even aspect-oriented languages cannot separate these parts. Tools are required. My research aims to demonstrate that using appropriate tools will allow the construction of better virtual machines with less effort.

To demonstrate the sorts of tools that are needed and how they are used, I have developed a toolkit for building virtual machines as well as a new virtual machine for Python. The toolkit handles the generation of interpreters and a compiler, as well as managing memory management, which makes the implementation of optimisers and compilers for dynamic languages such as Python much more feasible.

Using the tookit to build the new virtual machine means that its implementation is simplifed enough to be able to incorporate powerful optimisations which might otherwise be too time consuming. Combining these optimisations with the compilation ability provided by the toolkit further enhances the performance of the resulting virtual machine.

The Glasgow Virtual Machine Toolkit

The Glasgow Virtual Machine Toolkit (GVMT) allows easy construction of virtual machines. It handles garbage collection automatically, and builds interpreters and compilers from a common specification. The toolkit helps the rapid development of various sorts of interpreters, such as bytecode instrumentation and transformation passes, making the implementation of a high-performance virtual machine much easier.

You can download from it here.
Installation instructions
A manual

The HotPy Virtual Machine

The HotPy virtual machine is a high-performance virtual machine for Python. HotPy is a recursive acronym for:
  • HotPy
  • Optimising
  • Tracing
  • Python

The notable features of HotPy are:

  • It is built using the GVMT
  • The base VM is designed to be optimisable, and is simpler in internal design than the standard CPython VM.
  • It offers significantly improved performance by:
    • Tracing the bytecode to determine what to optimise and when.
    • Optimising the bytecode, using type information gathered at runtime.
    • Compiling the optimised bytecode using the GVMT generated compiler.
An overview of how it works can be found here.

The HotPy can be downloaded from here. You will need the GVMT and antlr2.x (Not version 3) to build and run it. You will also need to modifiy the Makefile to suit your machine. Good luck. When HotPy has an integrated parser the need for antlr will go, so there is no plan to update to antlr3.

Remember that HotPy is an experimental platform, not a plug-in replacement for CPython. If you want to help develop HotPy, then please email me.

Publications

Talks



[Home] [Research] [Courses] [Contacts] [Search]
Department of Computing Science 17 Lilybank Gardens, Glasgow G12 8RZ
Tel: +(0)141 330 4256, Fax: +(0)141 330 4913
searchcontactscourses and teachingresearchdepartment homepage