Montag, 6. Februar 2012

Beyond C/C++: High-level system programming in D

I spent a lot of time the last months thinking about what language to have a look into besides Java. There are so many other interesting languages like Ruby, Groovy, Scala, Clojure, Ceylon, Kotlin, etc. And whatever choice you make has quite some implications.

Now I got fascinated by a language very different from those just mentioned, which is intended for "high-level system programming". It is simply called "D". As the name suggests D is intended to be a successor language to C/C++. The language creator Walter Bright has spent much time of his career developing C and C++ compilers (for Datalight, Zortech, Symantec) and has therefore a very good understanding of issues with C/C++. Out of that experience and understanding he sat down to create a language claimed to be a "modern C/C++". D is some kind of Scala for system programming. It has almost all the features of Scala and other JVM-languages such as generics, metaprogramming, closures, true mixins (called template mixins), actors, functional propgramming extensions. But it is made for high performance and is not overloaded with, IMHO, too many features like Scala. Since D does not carry the burden of header files like C/C++, build times are also quite fast (I heard different things from Scala).

I recommend the book "The D Programming Language" by Andrei Alexandrescu which is a very good read where he explains what is the rational behind the various language constructs in D. The book is written in a very objective and competent way (without any stupid C/C++ bashing): this guy is a true engineer. I don't know whether I will be able to make any time for some spare time programming in D. (Doing some D programming is something I have added to my to do list for the day I win in the lottery and can do the entire day just what I would like to do). But reading the book by Alexandrescu has improved a lot my understanding about things in C/C++, system programming and language design.