Thread overview
The Image of D
Jul 24, 2004
the Novice Student
Jul 24, 2004
Andy Friesen
Jul 25, 2004
Elephant
Jul 25, 2004
Russ Lewis
July 24, 2004
Hello dear fellows!
I want to ask the great community about the purposes and roles of D besides
Systems Programming because this attribute of D is overshadowing its other
characteristics.
Is D a true general-purpose programming language ?
thanking you , Irfan.


July 24, 2004
the Novice Student wrote:
> Hello dear fellows!
> I want to ask the great community about the purposes and roles of D besides
> Systems Programming because this attribute of D is overshadowing its other
> characteristics.
> Is D a true general-purpose programming language ?
> thanking you , Irfan.

The really short version:

D is a simpler C++: it's easier to write and easier for compiler vendors to implement.  It's useful for pretty much anything C++ is.

Naturally, there are things C++ supports and vice versa, but the core feature set is the same.  The programming mentality is only really different because D has a garbage collector and built-in support for contracts and unit tests.

 -- andy
July 25, 2004
>The programming mentality is only really different because D has a garbage collector and built-in support for contracts and unit tests.

I disagree, i think the two differ alot, for me its about built in dyamic arrays, delegates, built in associative arrays, nested functions, proper support for interfaces, and an overall much cleaner design.


In article <cdujjr$19gc$1@digitaldaemon.com>, Andy Friesen says...
>
>the Novice Student wrote:
>> Hello dear fellows!
>> I want to ask the great community about the purposes and roles of D besides
>> Systems Programming because this attribute of D is overshadowing its other
>> characteristics.
>> Is D a true general-purpose programming language ?
>> thanking you , Irfan.
>
>The really short version:
>
>D is a simpler C++: it's easier to write and easier for compiler vendors to implement.  It's useful for pretty much anything C++ is.
>
>Naturally, there are things C++ supports and vice versa, but the core feature set is the same.  The programming mentality is only really different because D has a garbage collector and built-in support for contracts and unit tests.
>
>  -- andy


July 25, 2004
Elephant wrote:
>>The programming mentality is only really different because D has a garbage collector and built-in support for contracts and unit tests.
> 
> 
> I disagree, i think the two differ alot, for me its about built in dyamic
> arrays, delegates, built in associative arrays, nested functions, proper support
> for interfaces, and an overall much cleaner design.

From the programmer's perspective, you are right; D has a lot of cool features that make programming easier.  However, these are all implemented on top of a very C-ish sort of structure.  Every one of the "way" cool features can be done somehow in C/C++...it just takes a lot more lines of code to do them in the older languages.

Because of this, all new D features are optional.  You can still write old, "bare metal," C-style code.  You can even disable (and/or remove!) the garbage collector if you want.

Thus, anything you can write in C, you can write in D and expect it to work basically the same way.  But you can also use some of D's new features, and integrate them right into the C code just fine.

What this means is that D is a powerful, general-purpose language.  It has advanced features that let you write high-level code, but it can also let you write very low-level code (such as operating system kernels).

In fact, in the future I plan to rewrite a few of the Linux kernel source files as a demonstration of how D can interact with C!