Version 119 (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 effecful/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 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 11th November 2010
- I've migrated the project to this shiny new server at disciple.ouroborus.net. Yay for Trac 0.12
- I'm half way through fixing support for type signatures. Previously we were just using the value portion of the sig, but we need to check effect and closure information as well.
- I'm refactoring the slurper which extracts type constraints from the desugared program, which should fix some outstanding bugs in the type inferencer.
Erik de Castro Lopo (m3ga) -- updated 11th Nov 2010
- Making good progress on the LLVM backend. The idea is to have a -via-llvm command line option which would then generate object files using LLVM. The LLVM generated object files will be compatible with the object files generated using the C backend for easier debugging. Another goal for the backend is to make it easier to bootstrap the compiler (compile DDC with DDC) and to port the compiler to new platforms and architectures.
- I'm pretty much stalled on all the current bugs and waiting for Ben to finish the refactoring at which time I'll have another crack at them.
- Improvements to DDC's library.
Language
- Language Overview?
- Syntactic differences to Haskell?
- The Language Definition is still evolving and incomplete.
Installation
Fully supported: OSX/x86, Linux/x86, Linux/x86_64, Linux/PPC, FreeBSD/x86
Partially supported: Cygwin/x86?
Development
- Disciple Development Blog (benl23 + just ask)
- Erik's DDC Blog (m3ga)
- Compiler Commentary?
- 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
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
- Send mail to disciple-cafe at Google Groups.
- Ask in the #disciplined channel on the freenode IRC network.
Further Reading
- Ben's academic webpage
- Witnessing Mutability, Purity and Aliasing for Program Optimisation, submitted to JFP 2010
- Type Inference and Optimisation for an Impure World, ANU 2010 (PhD thesis)
- Witnessing Purity, Constancy and Mutability, slides, APLAS 2009
Related Work
Projects
- 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)
- The FX language 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:
- A Flexible Semantic Framework for Effects. Tate, Leijen, Lerner, 2011 (submitted).
- Type Inference with Natural Subtyping. Tate, Leijen, 2010.
- Inferring Method Effect Summaries for Nested Heap Regions. Vakilian, Dig, Bocchino et al, 2009.
- A Type and Effect System for Deterministic Parallel Java. Bocchino, Adve, Dig et al, 2009.
- Relational Semantics for Effect Based Program Transformations. Benton, Beringer, Hofmann, Kennedy, 2009.
- A Generic Type and Effect System. Marino, Millstein, 2009.
- Connecting Effects and Uniqueness with Adoption. Boyland, Retert, 2005.
Key Papers
- Polymorphic Effect Systems. Foundations for region and effect typing. Lucassen, Gifford, 1988.
- The Type and Effect Discipline. Core of DDC's type inference algorithm, and namesake. Talpin, Jouvelot, 1992.
- Polymorphic Typing of an Algorithmic Language. Foundations for closure typing. Leroy, 1992.
- The Calculus of Capabilities. Foundations for DDC's core language. Walker, Crary, Morrisett, 2000.