D Programming Language





It is a programming language used for general purpose applications and systems. It is a high level language that means the code written in D language is closer to human readable form. The code written in D language is high performing. It is neither a scripting language nor an interpreted language. This language is mainly for those who need work to be done fast, work to be reliable and code to be easy to understand and maintain. It is an Object Oriented language used for system and application programming. It was developed by Walter Bright from Digital Mars. The development of this language started in 1991


There are two versions of D language till now: D version 2 is used for new programs and D version 1 is used for maintenance code.
1) Text Editor - The source files contain the source code and these source files are saved
2) D Compiler – The D code is compiled directly into the machine code and this makes the


Different D Compilers available are:
1) DMD – The Digital Mars D Compiler is the official compiler and was developed by Walter
2) GDC – It was developed using the source code of DMD compiler.
3) LDC – This compiler is based on DMD front end.


To execute the D program, we need windows installer. Then downloaded executable is run to install D. Now the d file can be build and run. The program can be run by below commands: C:DProgramming> DMD firstprogram.d Here firstprogram.d is the file containing the source code.
The output of the above programming is Hello World.
Both single line and multiline comments are allowed in D language. Single line comments start with // and multiline comments are written within /* */. D programming language is case sensitive language. Here in D language variables with names time and Time are different. Whitespaces including blank lines, spaces and tabs are ignored in D program.


Lvalues and Rvaues in D language: 1) Lvalue – It can appear on either side of assignment operator. 2) Rvalue – It can appear only on the right side of the assignment operator.



Check out more on Hosting Funda