Mobile

Facebook Adopts D Language

By Adrian Bridgwater, October 16, 2013

Rapturous community reception to news that Facebook uses D for live production

Well-known D developer Andrei Alexandrescu has committed the first 5112 lines of D language code to Facebook's repository — meaning that as of now, the social network giant can be said to be using D in live production. The language was developed by Dr. Dobb's blogger, Walter Bright, who previously was the main developer of the first native C++ compiler, Zortech C++.

Alexandrescu confirms that the project is in what he calls "heavy daily use" at Facebook central — and, compared to the original version (which was written in C++) the team has measured "massive wins" across all elements including source code size, build speed, and runtime performance.

"D has resolutely exited C++'s shade because it is good at things C++ is not good at, in addition to being good at things C++ is good at. Also, Go would be tenuous to frame as a better C because it cannot do everything C does — e.g., unsafe memory access and manual memory management, which are needed in certain systems — and it interoperates poorly with C," said Alexandrescu.

D is touted as a general-purpose, high-level systems and applications programming language. It retains the ability to write high-performance code and interface directly with the operating system APIs and with hardware. In terms of use and usage, D is well suited to developing medium to large scale, million-line programs within team units of developers. In general terms, D is said to be easy to learn, provides many capabilities to aid the programmer, and is well suited to aggressive compiler optimization technology. In response to how D compares with other popular emerging native languages, such as Rust, Patrick Walton of the Mozilla Rust team noted: "Rust has safe manual memory management, at the cost of a learning curve. In D you must use the garbage collector if you want memory safety, but it avoids all the complexity of lifetimes and uniqueness. This difference makes the two languages feel pretty different, even if at their core they're pretty similar."

Community developers have already lauded this news and described it as the "call to arms" now happening after the language's development focus was directed towards "quality and professionalism" at the DConf conference held earlier this year. There has also been particular note made of the bug report, fix, resolution process, which has now markedly improved.

Walter Bright described this news as the "start of the first battle signalling the end of Middle Earth, and the rise of the Age of D." Other D developers, such as J. M. Davis, offered perhaps less hyperbolic assessments: "It doesn't mean that D has taken over the programming world or anything like that, but it shows that the language is maturing and that real companies are now willing to use it in the real world — and it's a pretty major company at that."

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task.
However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Video

This month's Dr. Dobb's Journal

This month,
Dr. Dobb's Journal is devoted to mobile programming. We introduce you to Apple's new Swift programming language, discuss the perils of being the third-most-popular mobile platform, revisit SQLite on Android
, and much more!