D (programming language)

D is a programming language that externally largely based on C .

D has been developed since 1999 by Walter Bright and was released on 3 January 2007 in the stable version 1.0.

From 17 June 2007 until the end of 2010 the version 2 of D was developed, which contains new features such as closures and pure functions, and the functional paradigm. With the release of the new version of the book D Programming Language by Andrei Alexandrescu has been published.

In February 2012, the Tango library was published completely usable and as a beta version.

Language resources

D accepts most language means the language C, dispensed in contrast to C but this on compatibility. This is to avoid the assumption of design drawbacks, by ABI compatibility all written in C programs and libraries are they are still usable. In contrast, the calling C code has some limitations.

D is an object oriented, imperative programming language that also offers from D2.0 possibilities of functional programming within an imperative programming language, and has class templates ( templates ) and overloadable operators. Compared to C , it also offers design by contract, modules and an integrated automatic garbage collection.

D programs can be written in without any pointer. So there are fields transparent both from the location of their data as well as from their length, so pointer arithmetic is unnecessary and the admissibility of field accesses can be checked at runtime. Unlike Java, it is nevertheless possible to use pointers as in C if necessary, and so close to the machine to be programmed.

Compiler

DMD, the Digital Mars D compiler, is the reference implementation of Walter Bright and x86/x86-64-Versionen for Windows, Linux, Mac OS X and FreeBSD available. The 64- bit version for Windows requires a currently installed Microsoft Visual C toolchain.

The most important unofficial translator with alternative backends are built on GCC GDC and LDC, which is based on the qualities of LLVM. Besides the high efficiency of the generated machine code these backends also allow the operation of x86-64 and various other architectures.

Meanwhile, two compilers for D were programmed in D itself: Dil and Dang, that are compatible with LLVM. A code generator for. NET platform is more of a proof of concept is as a working translator.

Development environments

D is increasingly supported by various IDEs.: Amongst other editors Entice Designer, Emacs, Vim, Scite, Scite4D, Smultron, TextMate, Zeus and Geany. Vim and Scite4D support syntax highlighting and auto-completion. For TextMate exists an extension, and Code :: Blocks supports D partially.

In addition, there are plugins for other IDEs: Eclipse supports D with the plugin DDT, for MonoDevelop there are mono -D.

There is written in D IDEs, such as Poseidon, supports autocomplete and refactoring and an integrated debugger. A debugger for D is Ddbg for Windows that can be used with a variety of IDEs or from the command line. The commercial ZeroBUGS debugger for Linux supports D experimentally; he brings with its own GUI. A relatively new IDE that supports autocomplete and debugging, D - IDE.

Program Example

/ / Program written in D2, which outputs its parameters   import std.stdio; / / Import the functions writefln ()   void main ( string [ ] args)   {     foreach (i, arg, args)       writefln ( " Parameter% d = '% s' ", i, arg); / / Each entry in the args field is output.   } The main function is passed the command line arguments as an array of characters (strings ). If you call this program under Windows with example.exe -win - s, then there is this text in a console window:

Parameter 0 = ' example.exe '   Parameter 1 = ' win'   Parameter 2 = '-s' See also: Hello World in D

250597
de