| • Science | • People | • Locations | • Timeline |
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 array s, closures, 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 assemblerInline assembler is a feature of programming languages, that enables very low level code written in assembler to be embedded in a high level language like C. This allows programmers to optimise a very performance-sensitive algorithm by sending individual is typical of the differentiation between D and application languages like JavaJava is an object-oriented programming language developed primarily by James Gosling and colleagues at Sun Microsystems. The language, initially called Oak (named after the oak trees outside Gosling's office), was intended to replace C++, although the fea and C#C (pronounced see-sharp is an object-oriented programming language developed by Microsoft as part of their. NET initiative. Microsoft based C# on C++ and the Java programming language. C# was designed to balance power (the C++ influence) with rapid develo. 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 operatorsIn computer programming, operator overloading (less commonly known as ad-hoc polymorphism) is a specific case of polymorphism in which some or all of operators like +, or are treated as polymorphic functions and as such have different behaviours depending. 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 .106.