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 |
| | | |
| (code) | (code) | (code) |
State of Play
This section summarises the main changes to the repository over the last month.
- 27/04/2012 Ben: Rewrote the war test driver to make it easier to add different sorts of tests, and folded the old thoth buildbot into it. ddc-war is now a separate Hackage package.
- 22/04/2012 m3ga/erikd: Fix failing tests. A couple of parser bugs had crept in and recent refactoring of the LLVM back end resulted in increased memory usage. Intent to do some profiling to see if this can be reduced again.
- 14/04/2012 Amos: Work on the Core language rewrite rule framework. Now have Const and witness conditions, to say that rules can only fire if values in a certain region will not be modified.
Language
Getting Started
Development
- Disciple Development Blog (benl23)
- Erik's DDC Blog (m3ga)
- Compiler Commentary
- Get the source
- Build the compiler and libraries
- Running tests and demos
- Development Builds
- Build Bots and Servers
- Building the Code documentation
- Syntax Highlighting
- Coding Conventions
- Using Darcs
- Debugging Help
- Memory and CPU Usage Profiling
- Making Patches
- Fixing Newbie Bugs
- Installing the full compiler
How you can help
- Download the compiler, write programs, and file bug reports!
How to get help
- Send mail to disciple-cafe at Google Groups.
- Ask in the #disciplined channel on the freenode IRC network.
Further Reading
- Ben's academic webpage
- Type Inference and Optimisation for an Impure World, ANU 2010 (PhD thesis)
- Witnessing Mutability, Purity and Aliasing for Program Optimisation, (DRAFT)
- Witnessing Purity, Constancy and Mutability, slides, APLAS 2009
Attachments
-
raytracer-thumb.png
(13.7 KB) -
added by benl 20 months ago.
-
nbody-thumb.png
(10.3 KB) -
added by benl 20 months ago.
-
styrene-thumb.png
(11.3 KB) -
added by benl 20 months ago.
