Video

Get the Flash Player to see this video.

For the best quality, click on the zoom button in the right corner.

Playback buffering? Try the lower quality version. You can also download the mp4 version.

Presentation slides (pdf).
 

Mnemonics - Type-safe bytecode generation with Scala
Johannes Rudolph

Mnemonics is a Scala library for generating method bodies in JVM bytecode at run time. Mnemonics supports a large subset of the JVM instructions, for which the static typing of the generator guarantees the well-formedness of the generated bytecode. The library exploits a number of features of Scala's type system (type inference, implicit parameters, and reflection) to guarantee that the compiler only accepts legal combinations of instructions at compile time. Additional instructions can be supported at the price of a check at run time of the generator. In either case, bytecode verification of generated code is guaranteed to succeed.