The basic work has already been done but a lot more could be done to make DMD more suitable as a library.
- Mostly removing global state. Also make the diagnostic handling configurable. Now all diagnostic messages that occurs after parsing are always outputted to stderr. Making more things pure is a good way to