OCaml Labs compiler hacking


Ninth OCaml compiler hacking evening (back in the lab, with a talk from Oleg)

05 Feb 2015

We'll be meeting in the Computer Lab next Tuesday (10th February 2015) for another evening of compiler hacking. All welcome! Please add yourself to the Doodle poll if you're planning to come along, and sign up to the mailing list to receive updates.

Talk: Generating code with polymorphic let (Oleg Kiselyov)

This time we'll be starting with a talk from Oleg Kiselyov:

Generating code with polymorphic let

One of the simplest ways of implementing staging is source-to-source translation from the quotation-unquotation code to code-generating combinators. For example, MetaOCaml could be implemented as a pre-processor to the ordinary OCaml. However simple, the approach is surprising productive and extensible, as Lightweight Modular Staging (LMS) in Scala has demonstrated. However, there is a fatal flaw: handling quotations that contain polymorphic let. The translation to code-generating combinators represents a future-stage let-binding with the present-staging lambda-binding, which is monomorphic. Even if polymorphic lambda-bindings are allowed, they require type annotations, which precludes the source-to-source translation.

We show the solution to the problem, using a different translation. It works with the current OCaml. It also almost works in theory, requiring a small extension to the relaxed value restriction. Surprisingly, this extension seems to be exactly the one needed to make the value restriction sound in a staged language with reference cells and cross-stage-persistence.

The old, seems completely settled question of value restriction is thrown deep-open in staged languages. We gain a profound problem to work on.

(Approximate) schedule

6pm Start, set up
6.30pm Talk
7pm Pizza
7.30pm-10pm Compiler hacking

Further details

Where: Room FW11, Computer Laboratory, Madingley Road

When: 6pm, Tuesday 10th February

Who: anyone interested in improving OCaml. Knowledge of OCaml programming will obviously be helpful, but prior experience of working on OCaml internals isn't necessary.

What: fixing bugs, implementing new features, learning about OCaml internals.

Wiki: https://github.com/ocamllabs/compiler-hacking/wiki

We're defining "compiler" pretty broadly, to include anything that's part of the standard distribution, which means at least the standard library, runtime, tools (ocamldep, ocamllex, ocamlyacc, etc.), ocamlbuild, the documentation, and the compiler itself. We'll have suggestions for mini-projects for various levels of experience (see also some things we've done on previous evenings), but feel free to come along and work on whatever you fancy.

We'll be ordering pizza, so if you want to be counted for food you should aim to arrive by 6pm.