DMD and Phobos Code Review

I’ve been spending time in dmd (via gdc) and libphobos as a research project. While I have enjoyed writing D code I quickly have run into some ugly aspects of D.

DMD source:

* Ambiguous labels with copious use of gotos
* Commented out printfs for tracing support
* Class and struct definitions scattered across multiple files
* Bugs?!

Phobos Runtime:

* Use of a stop the world, mark and sweet garbage collector! Suckage for realtime :( 
* Signals SIGUSR1, SIGUSR2 are used to pause all threads while garbage is collected
 * Buggy meta-programming that results in strange segfaults in objectInvariant() and gc methods.
* Unpredictable thread stalls in the simulation
* Non-cache friendly touching of memory during marking and collection

Good GC research

Boehm collector

I’m kinda pissed because I realized I would have to rewrite the runtime and the garbage collector. I bet JY could easily handle that.

This entry was posted in d. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>