D, a statically typed programming language with C-style syntax, aims to improve upon the complexity and learning curve of C and C++ while maintaining its hallmark speed.
The general-purpose systems and applications programming language allows writing of high-performance code and for programmers to interface directly with operating systems, but is designed to make the build process smoother by adding features to increase productivity and convenience. C++ was created to and succeeded in adding object-oriented programming to C, and D is a natural continuation of that evolution. While maintaining the look, feel and syntax of C++, D looks to uncomplicate the heavily documented C++ standard by jettisoning features such as the C preprocessor, compiler complexity and multiple inheritance while adding features such as one-to-one module correspondence and associative arrays.
(Related: Avail, an ‘articulate’ programming language)
According to the language’s overview, D is for “programmers who routinely use lint or similar code analysis tools to eliminate bugs before the code is even compiled,” “programmers who enjoy the expressive power of C++ but are frustrated by the need to expend much effort explicitly managing memory,” “programmers who think the language should provide enough features to obviate the continual necessity to manipulate pointers directly” and a literal laundry list of other use cases. The only limits on who should use D are beginners, or programmers looking to convert millions of lines of C++ code.
While the language has been around for nearly a decade and a half, D has only recently begun to gain some traction. D creator Walter Bright, a former Symantec software engineer, has been working on D since 2001. Andrei Alexandrescu, who now works on D in a research and development capacity at Facebook, joined him in 2006. In a recent Wired article, co-developer Alexandrescu elaborated on why and how the social networking giant is exploring the use of D in its back-end systems as a replacement for C++.
Facebook, which has hosted the past two D Conferences, is using D in a research capacity on its back-end, as a research team headed by Alexandrescu sets about rebuilding pieces of Facebook software: the Flint error identification software and the Warp preprocessor. Alexandrescu said that D is not only applicable to back-end programming, but to front-end and quick-and-dirty script writing as well. “Having a single language suitable for both the front and the back would be a lot more productive for programmers. D aims to be that language,” he said.
(Inside Hack, Facebook’s combined front-end programming language)
The development of D is guided by several main design goals. Ten of the most important principles are:
- Make it easier to write code that is portable from compiler to compiler, machine to machine, and operating system to operating system.
- Provide syntactic and semantic constructs that eliminate or at least reduce common mistakes.
- Support memory safe programming.
- Support multi-paradigm programming.
- Have a short learning curve for programmers comfortable with programming in C, C++ or Java.
- Where D code looks the same as C code, have it either behave the same or issue an error.
- Have a context-free grammar.
- Be able to build lightweight, standalone programs.
- Reduce the costs of creating documentation.
- Provide sufficient semantics to enable advances in compiler optimization technology.
D is still nowhere near any sort of mainstream adoption, but the weight of Facebook’s involvement along with the language’s popularity on GitHub and StackOverflow may indicate some growing momentum for a language that sees itself as the successor to C++.
For more information on D, visit the language’s website.