Search My Blog

Google
 
Foxkeh banners for Firefox 2

Monday, September 10, 2007

D Language...

D is an object-oriented, imperative, multiparadigm system programming language by Walter Bright of Digital Mars. It originated as a re-engineering of C++, but even though it is predominantly influenced by that language, it is not a variant of C++. D has redesigned some C++ features and has been influenced by concepts used in other programming languages, such as Java, C# and Eiffel. A stable version, 1.0, was released on January 2, 2007. An experimental version, 2.0, was released on June 17, 2007.

D is being designed with lessons learned from practical C++ usage rather than from a theoretical perspective. Even though it uses many C/C++ concepts it also discards some, and as such is not strictly backward compatible with C/C++ source code. It adds to the functionality of C++ by also implementing design by contract, unit testing, true modules, automatic memory management (garbage collection), first class arrays, associative arrays, dynamic arrays, array slicing, nested functions, inner classes, limited form of closures, anonymous functions, compile time function execution, lazy evaluation and has 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 Java style single inheritance with interfaces and mixins. D's declaration, statement and expression syntax closely matches that of C++.

The inline assembler typifies the differences between D and application languages like Java and C#. An inline assembler lets programmers enter machine-specific assembly code in with standard D code—a technique often used by system programmers to access the low-level features of the processor needed to run programs that interface directly with the underlying hardware, such as operating systems and device drivers.

D has built-in support for documentation comments, but so far only the compiler supplied by Digital Mars implements a documentation generator.

Programming paradigms

D supports three main programming paradigms—imperative, object-oriented, and metaprogramming.

Imperative

Imperative programming is almost identical to C. Functions, data, statements, declarations and expressions work just as C, and the C runtime library can be accessed directly.

Object oriented

OO programming in D is based on a single inheritance hierarchy, with all classes derived from class Object. Multiple inheritance is possible from interfaces (interfaces are a lot like C++ abstract classes).

Metaprogramming

Metaprogramming is supported by a combination of templates, compile time function execution, tuples, and string mixins.

Memory management

Memory is usually managed with garbage collection, but specific objects can be finalized immediately when they go out of scope. Explicit memory management is possible using the overloaded operators new and delete, and by simply calling C's malloc and free directly. Garbage collection can be disabled for individual objects, or even for a full program, if more control over memory management is desired. The manual gives many examples of how to implement different highly optimized memory management schemes for when garbage collection is inadequate in a program.

The langauge is still under a devlopment phase.

JAVA

Java refers to a number of computer software products and specifications from Sun Microsystems that together provide a system for developing and deploying cross-platform applications. Java is used in a wide variety of computing platforms spanning from embedded devices and cell phones on the low end to enterprise servers and super computers on the high end. Java is fairly ubiquitous in cell phones, Web servers and enterprise applications, and somewhat less common in desktop applications, though users may have come across Java applets when browsing the Web.

Sun Microsystems referred to Java as the "Java technology" but has used the word "Java" as an adjective about "technology." In practice, many programmers have used the word "Java" to mean the programming language, while the execution platform was called the "JRE" (Java Runtime Environment) and the compiler-system was called the "JDK" (Java Development Kit), rather than a "Java compiler" as such. The word "Java" has often been used as an adjective, but the formal term "Java technology" should be noted.

Writing in the Java programming language is the primary way to produce code that will be deployed as Java byte code, though there are compilers available for other languages such as Java Script, Python and Ruby, and a native Java scripting language called Groovy. Java syntax borrows heavily from C and C++ but it eliminates certain low-level constructs such as pointers and has a very simple memory model where every object is allocated on the heap and all variables of object types are references.

Java has non-object primitive types but every other data type is an object. The Java class libraries provide wrapper objects for the primitive types, and since Java SE 5.0 the Java compiler automatically inserts conversions between a wrapper type and its corresponding primitive. Memory management is handled through integrated automatic garbage collection performed by the JVM.

The current version, Mustang Java SE 6.0, is bundled with a database manager, facilitates the use of scripting languages (currently Java Script using Mozilla's Rhino engine) with the JVM, has Visual Basic language support, and has native UI enhancements to support the look and feel of Windows Vista.

Sun Microsystems has made the bulk of its implementation of Java available under the GNU General Public License, although there are still a few parts distributed as precompiled binaries due to intellectual property restrictions.

Java has been put to various uses:

Desktop use


On the desktop, stand-alone Java applications remain relatively rare for several reasons.
1. Java applications often use more memory than native applications because of the overhead for the Java runtime.

2. Graphical user interfaces for Java applications tend not to follow the platform-specific Human interface guidelines the user is accustomed to.
3. Tools used to develop graphical Java applications are fragmented.
4 . Installation of the Java Runtime Environment adds an extra step to deploying Java-based applications, since Microsoft Windows no longer bundles a Java runtime environment. In addition, there are multiple versions of the JRE, which can introduce compatibility issues for

Java applications installed on a system


Mobile Applications & Other Net Applications are there.