Semester projects

Scala SBT build

keywords: scala, sbt

Goal

Scala currently uses ant for its build. This build bootstraps the libraries and compiler and runs a number of tests using the partest tool. The ant script to do this is 1628 lines of XML long and is quite hard to maintain. Fortunately, there is now a better alternative with SBT, a Simple Build Tool which is written in Scala and which uses Scala as its build language. Your task in this project is to duplicate the behavior of the current ant script in SBT. If sucessful, your new script will replace ant in all Scala builds.

offered by LAMP

Scala bytecode viewer

keywords: scala, java bytecode, swing

The Scala compiler generates ordinary java classfiles which can be inspected with any available bytecode tool (e.g. javap, jad, jclasslib). However, every classfile originating from Scala is equipped with additional metadata (the ``Scala signature'') in the form of a classfile attribute, which contains information about the types, symbols and annotations appearing in the class. Since existing tools are not aware of the Scala signature attribute they are not able to decode and display its content.

Goal

The goal of this project is to extend the jclasslib graphical java bytecode viewer to display the contents of the Scala signature attribute. jclasslib is written in Java and uses swing for its graphical user interface.

Your task

A reflection library for Scala which decodes the binary representation of the Scala signature attribute and provides it's content through a nice API is currently in the works by Gilles Dubochet. Your task is to create a clean and user-friendly graphical representation of the information provided by the reflection library. Since the library is written in Scala we encourage you to write the jclasslib extension in Scala as well.

offered by Lukas Rytz

Scala benchmark suite

keywords: scala, benchmarking

Goal

The goal of this project would be to develop a benchmark suite that can be used to assess how changes to the Scala compiler and libraries affect the space and time usage of various operations, programming patterns and idioms, etc.

offered by LAMP.

Master projects

Scala binary healing tool

keywords: scala, binary compatibility, traits

Traits in Scala are essential units of program composition. Unfortunately they cause serious problems for binary compatibility. When a trait gets new method implementations, all classes extending that trait have to be recompiled so that they can get methods that forward to the new implementations. Similar recompilation requirements apply to traits that get new fields. These binary compatibility violations become more and more problematic with the maturing of the Scala software industry, because packages become more interlinked, dependencies become more complicated, and and consequently re-compilation chains become longer.

Goal

In this project, you will develop a tool that solves the binary compatibility problem for traits. The idea is to apply byte-code rewriting on class files that need to be upgraded. The tool would inspect all files in a list of provided jars, or all class files on the classpath, and determine which method definitions need to be added to classes so that they can implement all scala traits without AbstractMethodErrors. It would then add the necessary methods by forwarding to the traits implementation classes.

If there is time, you could also investigate whether analogous techniques can be applied ditrectly in the class-loader or as part of a Scala runtime agent.

This project can also be a large semester project.

offered by LAMP

Thread-Locality Checker for Scala

keywords: static analysis, encapsulation, object-oriented programming

The goal of this project is to implement a simple annotation checker for thread-local objects in Scala. Checking for thread-locality has many uses in concurrent and parallel programming. In Scala, we want to use it to find potential bugs in programs using concurrent processes called actors.

Goal

In this project you implement a thread-locality checker as a plug-in for the Scala compiler (there is a tutorial for writing compiler plug-ins). Classes and types are annotated to express thread-locality and unintended leaks are detected at compile-time. The system can be implemented without any changes to the Scala language syntax. The only addition is two new metadata annotations.

offered by Philipp Haller.

Inferring Non-Aliasing and Uniqueness

keywords: type systems, static analysis, aliasing, encapsulation, object-oriented programming

Inferring non-aliasing and uniqueness properties of object references has many applications in object-oriented programming languages such as Scala, e.g. in optimization and verification. We are particularly interested in compile-time checking of race safety in concurrent programs.

Goal

The goal of this Master project is to design and implement a static analysis tool that automatically infers non-aliasing and uniqueness properties of references in Scala programs. The design should be based on a type inference algorithm for a uniqueness type system, which we recently developed for checking race safety in concurrent programs.

offered by Philipp Haller.

Java Tree Shaker

keywords: java bytecode, whole program analysis

Applications for embedded systems, such as J2ME and Android should be kept small. Furthermore, libraries have to be uploaded to devices with limited memory, and many times only a small fraction of such libraries is needed at runtime. Tree shakers are tools that analyze an application and determine the minimal set of classes needed at runtime. This involves a whole program analysis on what methods may be called at each call site, and transitively including all dependencies of those methods. In the end, and if reflection is not used, the set of classes necessary at runtime is obtain. Data flow analysis may be used to improve the precision of method resolution.

Goal

Your goal is to design and implement such a tool for Java bytecode. The Scala compiler has already the infrastructure for data flow analysis, and a java bytecode reader. You will need to familiarize with the Scala compiler backend and use this framework to implement the tree shaker.

offered by Iulian Dragos.