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.
State of Play
DDC is being rewritten to use a cleaned-up core language similar to what GHC now uses. The original (alpha) version of the compiler is still available in the source repository, but work on it has ceased.
The new DDC is currently at a stage where it will parse and type-check core programs, and compile recursive functions over lists. There is also an interpreter that we use to experiment with the language design. We don't do type inference yet, so the core program contains lots of type annotations. These will go away in later versions. Example Code
This section summarises the main changes to the repository over the last month.
- 23/4/2013 Work on ddc-core-flow and the Thread transform to support the new Repa GHC plugin that will be in Repa 4.
Current Release
The current release is DDC 0.3.1 (December 2012). Release Notes.
DDC consists of the following packages:
- ddc-tools Command line tools. This is the user interface for the other packages.
- ddc-core Defines the abstract syntax, type checker, and substitution operators.
- ddc-core-eval Provides a single step evaluator (interpreter). It is a direct implementation of the operational semantics.
- ddc-core-simpl Implements simplifying code transformations and analyses.
- ddc-core-salt Intermediate representation for C like languages, and C code generator.
- ddc-core-llvm LLVM code generator.
- ddc-build Build framework.
- ddc-driver Top-level compiler driver.
- ddc-base Re-exports the main external dependencies of the Disciplined Disciple Compiler project.
Language
Tutorials
- Installation
- Expressions and the Evaluator
- Compilation and Code Generation
- Program Transforms
- Guided Optimisation
Development
- Development Builds
- Coding Conventions
- Build Bots and Servers
- Haddock Code Documentation
- Memory and CPU Usage Profiling
- Debugging Help
- Using Darcs
- Making Patches
- Release Process
How you can help
- Download the compiler, do the tutorial, write programs.
- File bug reports, fix tickets on the trac.
- Complain if you can't work something out.
How to get help
- Ask questions on disciple-cafe at Google Groups.
- Commit messages go to disciple-log at Google Groups.
- Ask in the #disciplined channel on the freenode IRC network.
Further Reading
- Rewrite Rules for the Disciplined Disciple Compiler, Robinson, UNSW 2012
- Type Based Aliasing Control for the Disciplined Disciple Compiler, slides, Ma, UNSW 2012
- Type Inference and Optimisation for an Impure World, Lippmeier, ANU 2010
- Witnessing Purity, Constancy and Mutability, slides, Lippmeier, APLAS 2009
- Disciple Development Blog (benl23)
- Erik's DDC Blog (m3ga)
