D (language)

There was several computer programming languages called D during the history of the Informatique.

* a language (developed in this article) was created by Walter Bright.
* another language, called Dialog Manager, is presented in another article.

----

D is an imperative computer programming language directed object. It was created by Walter Bright in December 1999 with its company DIGITAL Mars, and it is presented like the successor of the C, from where its name (the language C itself succeeded the language B, which as for him does not derive from a language has, but BCPL. Before the creation of C++, one wondered a long time if the successor of C would be called D, according to the alphabetical order, or P, according to the order of the letters in the name of BCPL).

It takes as a starting point the language Java with which it shares the concept of “Ramasse-miettes” and of simple heritage; on the other hand its programs are compiled in Machine language.

The origin

Walter Bright imagined this language by realizing that the expressivity of the C or the C++, which gives them their processing capability, makes their use sensitive.

In particular:

  • the creation and the maintenance of compiler is difficult.
  • syntax overall badly included/understood introduced bugs by simple ignorance or carelessness.

To mitigate these problems, the language D has a purified syntax of C of which one of the effects is to make compilation faster. Thus, coupled with modern concepts included in the language, the productivity is improved.

If a language can recover 90% of the power of C++ but only 10% of its complexity, that is worth largely the blow ” ~ Walter Bright

D is in version 1.00 (since beginning 2007), and punctually undergoes light modifications of specification. These transformations are carried out exclusively by Walter Bright, but it takes into account remarks and requests of the community which revolves around D .

The compiler is developed in parallel with the specification of the language. Part of its code is opened, which makes it possible to correct the problems quickly that one can meet, and to produce its own compiler by using a base (one of the dreams of the author is indeed to see of it flowering of others that it his). There currently exists for the platforms Linux, Mac OS X and Windows. A version GNU is being born, under the name of gdc.

Its characteristics

D introduces into its specifications the elements of the Programmation by contract, unit Test, and truths module S which improve quality and facilitate the maintenance of the code. The anonymous functions, the structures of table, the “Template S” and especially the “Ramasse-miettes” makes it possible to make D a simple language of use. The language D finally makes it possible to program in low level and the interfacing with libraries written in C.

The object

The programming object in D supports the encapsulation of object, the heritage, polymorphism, the paradigm of the single Héritage extended by interfaces and true “properties”. Instanciation is done only by reference and leaves control on the initialization of the static attributes. All these points return the D very near to the Java and the C#.

Low coding level

D allows contrary to C# and of the Java to embark code assembler in the programs. This characteristic opposes the possibilities of portability of the code, but on the other hand makes it possible to use the language to reach the peripherals as do it the operating systems or the pilot S, or to make powerful optimizations of code while reaching special instructions of the Microprocesseur.

The table tidy

The Ramasse-miettes in D is flexible and makes it possible to the programmer to release to him even his memory. This manager was introduced to facilitate the programming of the every day and can be decontaminated to reduce the consumption of the resources processor according to the needs for the developed application.

Examples

The famous " Hello World" , example of reference for all the languages: importation std.stdio; int hand () { writefln (" Hello world! "); return 0; }

And a second example: // Programs in D which posts the arguments of the line of order. importation std.stdio; int hand (tank [] args) { foreach (int I, tank arg; args) { writefln (" args I, " = '" , arg, " '"); } return 0; }

External bonds

Internet sites

  • DigitalMars D, the official site.

  • Wiki4D, Wiki gathering of the assistances on D.
  • dsource.org, a community providing of the services of lodging of code for projects of Free software.

Compilers

  • DigitalMars D (DMD), a compiler for Windows and Linux.

  • gdc, a free compiler (LPG) (frontend of GCC) multi platforms (Windows, Linux…)
  • gdcwin, gdc for Windows.
  • gdcmac, gdc for Mac OS X.

Random links:Babar | Carlos Cruz (boxeador) | The Community of communes of the Coast of the Blacks | Shanghai Y-10 | Elon Howard Eaton | Hans Filbinger | Banlieue_noire_de_Blacklick,_Pennsylvanie