Implementing A Universe Type System for Scala
Manfred Stock
Master Thesis Project Report
Software Component Technology Group
Department of Computer Science
ETH Zurich
http://sct.inf.ethz.ch/
August 2007 – January 2008
Abstract
The Universe type system is based on the concept of ownership where everyobject has at most one owner object. It structures the object store usingdifferent contexts, which are sets of objects with the same owner, andrestricts how references can be passed and used. When enforcing theowner-as-modifier property, the Universe type system guarantees that anymodification of an object can only be initiated by its owner object.
Scala is a multi-paradigm programming language combining features ofobject-oriented and functional languages. It supports compiler plugins andannotations on types which allows the implementation of additional typeconstraints such as those imposed by the Universe type system.
This thesis presents an implementation of the Universe type system forScala. The implementation supports a subset of the Scala language. Itprovides two compiler plugins for the Scala compiler and a set ofannotations for the use in programs. One plugin performs the staticUniverse type checks and the other plugin inserts additional runtimechecks during compilation.