silvercircle/github/io
Twitter Facebook Google+ Google+ Email

Diving into the D language

Last modified:
525 Words
18:51 | by Alex Vie in Development
Reading time: approx. 2 minute(s).

When I first checked out D many years ago (in the days of D1), I found it an interesting concept, but the language had little value for practical use. The reference compiler was a fast moving and - at some times - fairly buggy and problematic piece of software. The same was true for the standard library, or should I say, both standard libraries, because there were in fact two and to make things worse, they were not really compatible.

The project was lacking in quality and direction and the most common reasons were given as following:

  • the project was very ambitious from the beginning, maybe over-ambitious to some extent. No less than a successor for C++ was (and still is) the goal for D, set by its author, Walter Bright1.

  • lack of manpower. For a long time, D was basically a one man project by Bright himself and realistically, this isn’t doable by a single person, no matter how qualified and skilled that person might be. It’s simply too much work to be finished by a single person in any reasonable time frame.

Most of the issues are long solved and today D presents itself as a mature programming language with a stable reference compiler and standard library (Phobos). Additionally, two more compilers are available:

  • GDC, a GCC based compiler that runs on many Unix-like systems, Windows and OS X in both 32- and 64-bit versions.

  • LDC, a DMD command line compatible compiler based on the LLVM infrastructure that supports 32- and 64-bit targets on Linux, OS X, Windows and Android. Available for Linux, OS X and Windows. Cross-compiling is possible.

While DMD remains the reference compiler, both GDC and LDC can produce significantly better optimized and thus faster code, particularly for 64bit targets, simply because GCC and LLVM are two highly tested and mature platforms.

Template programming

This excellent document about template programming in D, which is a bit more complex (but also much more powerful) than typical generics in other languages. The author of this long documents starts with the basic concepts and gradually dives deeper into the matter before showing how D’s various features in the area can be used for meta programming and practical use cases. This is an excellent read for people who already understand the concepts of templates and generics and want to learn D’s implementation of these concepts.

http://www.semitwist.com/articles/EfficientAndFlexible/SinglePage/

Environments

Since D still lacks popularity, the number of high quality tools for programming in D is somewhat limited. Many modern editors do support syntax highlighting for D, but more advanced support for auto-completion and error checking is still rare. There is an add-on for Eclipse and an extension for Visual Studio. Other possible

SlickEdit as IDE for the D language
SlickEdit as IDE for the D language
SlickEdit as IDE for the D language
  1. Walter Bright is a renowned expert on programming languages, particularly compiler design with 3 decades of experience in the area. With Zortech C++, Bright authored the first C++ compiler for the Windows operating system, at a time when Microsoft’s own compiler only understood ANSI C.