Version 136 (modified by benl, 9 years ago) (diff)


The Disciplined Disciple Compiler (DDC)

Disciple is a dialect of Haskell that uses strict evaluation as the default and supports destructive update of arbitrary data structures. Disciple includes region, effect and closure typing, and this extra information provides a handle on the operational behaviour of code that isn't available in other languages. Programs can be written in either a pure/functional or effectful/imperative style, and one of our goals is to provide both styles coherently in the same language. The two styles can be mixed safely, for example: when using laziness the type system guarantees that computations with visible side effects are not suspended. Many Haskell programs are also Disciple programs, or will run with minor changes. Our target applications are the ones that you always find yourself writing C programs for, because existing functional languages are too slow, use too much memory, or don't let you update the data that you need to.

DDC is still in the "research prototype" stage, meaning that it will compile programs if you are nice to it, but expect compiler panics and missing features. You'll get panics due to ungraceful handling of errors in the source code, but valid programs should compile ok. Here are some working examples, along with their Disciple source code:

Ray Tracer N-Body Styrene
No image "raytracer-thumb.png" attached to WikiStart No image "nbody-thumb.png" attached to WikiStart No image "styrene-thumb.png" attached to WikiStart
(code) (code) (code)

State of Play

This section records what the DDC developers are actively working on. If you're hacking on something DDC related then by all means add yourself here. Records are dropped off if they're older than about a month.

Ben Lippmeier (benl23) -- updated 3rd Jan 2011

  • I've just finished redoing how primops are handled. It was a long overdue cleanup, which also makes it easier for the LLVM backend.
  • I got the reviews back for the paper I submitted to JFP on the DDC core language. The reviews were very helpful, though the bottom line was it needs more motivation and meta-theory. Motivation for the language design is easy enough to 'port across from my thesis. For the meta-theory, it needs a proof of observational equivalence for the example optimisations, showing how the witnesses are used. I had worked examples in the paper, but no formal proofs. I started on the proofs over the christmas break, and have most of the structure for one showing that let-floating is sound (changing the order of let-bindings with non-interferring effects). It'll be two or three weeks work (full type equivalent) to finish the proofs and update the paper.
  • The paper reviews have also convinced me that we want explicit allocation effects. Tracking which expressions allocate helps with hoisting expressions out of lambdas (also known as the full-laziness transform). It is sufficient to check that the binding to be hoisted performs no world or read/write effects, and only returns constant data, but using allocation effects will make the reasoning clearer.
  • In the type inferencer, it turns out that strengthening more-than constraints to equality constraints during inference breaks tests that use interesting higher order functions (like with parser combinators). We still want to do the strengthening for the reasons discussed in my thesis, but it should be done while converting the desugared language to core, instead of during inference, which is fairly obvious in hindsight.

Erik de Castro Lopo (m3ga) -- updated 2nd Jan 2011

  • The LLVM backend is basically done and is already showing improved runtime performance compared with the C backend. A few small issues remain and are being worked on.
  • Plan to examine all the currently open bugs to see if any can be easily fixed and closed.
  • Improvements to DDC's library.



Fully supported: OSX/x86, Linux/x86, Linux/x86_64, Linux/PPC, FreeBSD/x86
Partially supported: Cygwin/x86?


How you can help

  • Download the compiler, write programs, and file bug reports!
  • Write more tests. Cute graphical demos are especially fun.
  • Fix bugs! The ones on the newbie list should be easy to get started on, otherwise we're pushing for the 0.1.3 release
  • 'port across GHC base libraries like Data.Either and Data.Map.

How to get help

Further Reading

Related Work

Another bibliography by Jianzhou Zhao


  • Eff. Bauer, Pretnar. (active)
  • BitC. A functional language with first class mutability. Shapiro, Sridhar, Doerrie. (active)
  • Timber A real-time Haskell like language. Nordlander et al. (active)
  • Cyclone A type safe dialect of C using region typing. Grossman, Hicks, Jim, Morrisett, Swamy, Wang et al. (active)
  • MLKit A ML compiler using region typing. Elsman, Hallenberg, Varming, Tofte, Birkedal et al. (active)
  • FX The original effect typing system. Gifford, Jouvelot et al. (inactive)

Recent Papers

If you know of other recent work on effects, region typing, controlling mutability, or capability calculi then please add it here. We are particularly interested in systems that can express the noninterference of concurrent threads in their type systems, while not requiring all data to be constant (as in Haskell), and not adding intermediate messaging protocols (as in Erlang or with STM).

Key Papers