Exupery projects for Summer of Code 2007
Last updated at 9:04 pm UTC on 16 March 2007

### Mentor

Exupery Fast 32 bit Integer Plan

### Difficulty

Advanced in general programming but a decent introduction to language implementation.

### Project Outline

Exupery is a compiler written in Smalltalk that compiles bytecodes to machine code. It is currently under heavy development, and there are many areas where it can be improved, including:
• Profiling and primitive writing
• Floating point support
• Fast 32 bit integers
• A Mac port
and many others

### Technical Details

Profiling and primitive writing would involve taking some macro benchmark, say a few crypto kernels, profiling them, figuring out what primitives need to be written to make them perform well, then writing the primitives. Fast 32 bit integers would be useful for crypto.

Floating point support and fast 32 bit integers would involve refactoring the handling of arithmetic messages (+, -, /, and &star) then writing basic Exupery primitives for them. Then adding a simple optimizer to remove the boxing and deboxing inside statements.
The goal would be to allow
`a := b + c + d + e.`
, when run on floats or 32 bit integers to only create one object that is stored in a; then to allow
`a at: x put: (b at: x) + (c at: x)`
to not generate any objects where a, b, and c are float arrays or integer arrays and x is just a SmallInteger index.
This should be possible just using type feedback, primitive inlining, and simple tree traversal optimization all of which exist in Exupery now but are not developed enough for this case.

### Benefits to the Student

Get practical exposure to compiler development and test driven development.

### Benefits to the Community

The ability to write fast 32 bit arithmatic in a pure dynamically typed language. In Smalltalk integers are objects that are either small tagged values or boxed large integers. These semantics provide a pleasant safe programming environment for most applications but lead to inefficencies when working with algorithms that rely on fixed size integers. Cryptography works heavily with 32 bit integers providing a practical set of benchmarks.

The techniques outlined are equally useful for floating point calculations. Demonstrating a simple practical way of combining dynamic type feed back and very simple optimisations (just tree rewriting) to provide decent performance for both 32 bit arithmatic and floating point calculations.

The project uses 32 bit integers because they are practical and to avoid needing to implement floating point instruction set support during the summer project. The optimisation framework and code should be directly applicable to floating point calculations as well.

### Interested Students

• Yakov Zaytsev (iakovz)