Details, Explanation and Meaning About D programming language

D programming language Guide, Meaning , Facts, Information and Description

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.

This language takes some features of C, C++ and a few other Algol syntax based programming languages, and drops other features.

D drops older C++ features like the preprocessor and forward declarations. It adds modern features like design by contract, unit testing, true modules, automatic memory management (garbage collection), first class arrays, closuress, 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 microprocessor needed to run programs that interface directly with the underlying hardware, such as operating systems and device drivers.

Unlike Java, but like C++ and C#, D allows the programmer to overload operators. Like Java, D uses garbage collection, but it also allows the programmer to request that specific objects be finalized immediately when they go out of scope.

D also includes an interface to C's standard library: routines and libraries written in C can be easily called from D, although there is no interface with C++. There are many features to support version and platform checking while compiling programs--tasks that are often accomplished in an ad-hoc manner with C's pre-processor.

D is intended to be compiled directly into native code, and takes performance issues seriously. When implementing an application in D you usually get slightly increased memory allocation, and slightly decreased execution time, compared to the same application implemented in C++.

D is under heavy development: new features and fixes are appearing every month. Some of these changes could possibly 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. The current version is .105.

Example

// D program to print 'hello world' followed by its command line arguments
import std.stdio;
int main(char[][] args) {
   writefln("hello world");
   foreach (int i, char[] arg; args)
      writefln("args[", i, "] = '", arg, "'");
   return 0;
}

External links


This is an Article on D programming language. Page Contains Information, Facts Details or Explanation Guide About D programming language


Google
 
Web www.E-paranoids.com

Search Anything