Quick C--
``Bringing you compiler technology that is well
understood, but difficult to implement''
C--
is intended as a ``portable assembly language'' that can replace C as
a target language used by compiler writers.
After long hard labor,
Simon Peyton
Jones
and Norman Ramsey have produced a design that
supports a simple C-like core, plus support for
garbage collection and
exception handling.
The goal of the Quick C-- project is to test those ideas in
an implementation, which Ramsey is working on with
Christian Lindig.
Why another C-- compiler?
To realize our dream for C--, a useful next step will be a simple,
nonoptimizing compiler that supports the run-time interface.
Our primary goal is to to validate our design
experimentally.
A secondary, but still significant goal is to provide a
vehicle for experimenting with new techniques for building
retargetable compilers.
These goals push us toward certain points in the design space.
- The implementation of the compiler itself should be simple and well
documented.
We should make particular efforts to document the interactions between
our implementation and the design of the C-- language and its
run-time interface.
The implementation will help validate our design, by testing
whether the design is susceptible of a clean implementation.
- The next step in validation is to find out if the design is
suitable for its intended purpose.
In addition to using C-- as a back end for GHC,
we hope to engage colleagues who will use C-- to implement their
compilers.
We want to craft our compiler to be easy to use; in particular,
the compiler should be
- Easy to retarget to the platform of choice,
- Blindingly fast, and
- Easy to specialize.
I believe the most important specialization is the calling
convention.
I imagine that at first, users will ask for calling conventions with
particular properties, and we will add them to the compiler ourselves.
Later, we hope to enable users to add conventions on their own,
without our help.
- The compiler need not produce heavily optimized code.
We are aiming for something about the quality of lcc.
- The implementation language of the compiler itself should be well
suited to compiler construction, and implementations should be fairly
widely available.
Ideally, it will be easy for students to make contributions to the
project.
Objective CAML is our tentative choice.
- We should be able to imagine a path to an aggressively optimized
compiler.
These criteria suggest some implementation choices:
Quick C-- is supported by a generous gift from Microsoft Research.
Back to Norman Ramsey's home page.