Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Source for the D.NET Compiler is Now Available

Source for the D.NET Compiler is Now Available

This item in japanese


D is a relatively new language that, like ObjectiveC, tries to address some of the more serious problems in C++. From our interview with Cristian Vlasceanu,

In many ways D encourages the "right" behavior. For example, in C and C++, if you write "int i;" the variable is uninitialized. To do the "right thing", the programmer needs to type extra keystrokes as in "int i = 0;" but D works the other way around: "int i;" safely sets the variable to a default value (that in this case is zero). To make it uninitialized you have to spend extra effort and type "int i = void;" expressing that the uninitialized variable is intentional and not due to laziness.

D.NET is an experimental port of the D language to the Common Language Runtime. It consists of two parts, a front-end and a back-end component. The front-end component handles the parsing of source code and the generation of abstract syntax trees. The back-end compiler takes that and generates the actual machine code, or in this case IL code. While the source for both are available on CodePlex, only the back-end is maintained there. The front-end component is straight out of the D 2.0 Programming Language Compiler.

A word of caution,

The back-end code is not of production quality, it is intended for research and educational purposes. The D Programming Language is a fairly complex language, and non-trivial features such as TLS and closures make it an interesting case study for generating IL code.

Rate this Article


Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • D.NET Loses Something

    by Eric Smith,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    When I learned about D (and wrote a teeny bit of code with it) a few years back, it looked extremely interesting. Here was a language that was appropriate for native/system coding but that had features of more modern environments compared to C++, like garbage collection, unit testing and design by contract.

    I'm not sure that a .NET targeted compiler is quite as compelling when compared to C#, but it would be cool to see D take off for cases when native code is more appropriate.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p