Science Fair Project Encyclopedia
D programming language
- There have been several programming languages called D during the history of computing. The one discussed in this article is that created by Walter Bright. The one called Dialog Manager is discussed on another page.
D is an object-oriented, imperative systems programming language designed by Walter Bright of Digital Mars as a successor to C++. Some other successors to C++ include Java, and C#.
D adds modern features like design by contract, unit testing, true modules, automatic memory management (garbage collection), first class arrays, closures (anonymous functions), and a reengineered template syntax. D retains C++'s ability to do low-level coding, and adds to it with support for an integrated inline assembler. C++ multiple inheritance is replaced by single inheritance with interfaces. D's declaration, statement and expression syntax closely matches C++.
The inline assembler is typical of the differentiation between D and application languages like Java and C#. An inline assembler allows a programmer to enter machine-specific assembly code alongside standard D code—a technique often used by systems programmers to access the low-level features of the processor needed to run programs that interface directly with the underlying hardware, such as operating systems and device drivers.
D uses garbage collection, but also allows the programmer to request that specific objects be finalized immediately when they go out of scope. It is also possible to disable garbage collection for individual objects or an entire program if more control over memory management is desired.
D also includes an interface to C's standard library: routines and libraries written in C can be called from D, although there is no interface with C++.
D is intended to be compiled directly into native code for efficient execution.
D is still under development, and changes to the language are made regularly. Some of these could break D programs written for older versions of the language and compiler. The official compiler by Walter Bright defines the language itself, and it is in continuous beta testing state.
Example
// D program that prints its command line arguments
import std.stdio;
void main(char[][] args)
{
foreach(int i, char[] a; args)
writefln("args[%d] = '%s'", i, a);
}
External links
- Digital Mars: D programming language
- D WinLib windows library from Codemoon
- Open Directory Project: D programming Language
- DSource, an open source community for the D Programming Language.
- Dprogramming.com, home of the DFL windowing library.
- Wiki4D, "the wiki for the d programming language"
- The Programming Language Shootout
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details


