# The D programming language



## wiz (Dec 2, 2002)

D 

if (u haven't heard of it) {
 check it out.
} else if (you have) {
is there a mac port of the D complier and tools?
}


----------



## Captain Code (Dec 2, 2002)

Interesting language.  I haven't heard of any compilers for the Mac yet.


----------



## whitesaint (Dec 3, 2002)

VERY Interesting...Can't wait to see a port for OS X.


----------



## wiz (Dec 3, 2002)

yep!!

And OpenD.org is dedicated to porting  the D programming language in Open Source.


----------



## jazz (Dec 17, 2002)

looks pretty much like a cross between c++ and objective-c.  I don't really see the need when you could just use objective-c++.

stuff like

class foo{
	foo();
	};

going to

class foo{
	this();
	};


is not really needed.  There is nothing wrong with the first, and if someone just looks at the implementation file, it will be easier to understand the first way.  Not to mention there will be very few (if any) changes when it goes to assembly (for the whole language).  The way it looks now, Java is the way to go for future languages because of it's compatibility.


----------



## wiz (Dec 19, 2002)

True, in most new languages, the influence of the Java syntax and structure is quite noticible. 

Java is the way to go, but D isin't that bad, its basically the newest [C/C++]-like or Java-like language, and includes the best of those languages. (including others)

In other words you could say D has evolved from other languages.

Changes made to a language is usually based on experience. Hence the newer the language, it's possible, the better it is.


----------



## jazz (Dec 21, 2002)

Umm, no.  That's just a general, "no" in repsonse to everything.  The first statement:



> _Originally posted by X-wiZeroS _
> *True, in most new languages, the influence of the Java syntax and structure is quite noticible. *



These are all C influenced, not Java.  This new D language is almost the exact same syntax as C++.



> *Changes made to a language is usually based on experience. Hence the newer the language, it's possible, the better it is. *



They most certainly are not.  A few languages perhaps, but new languages are created for a specific need to complete a project.   The same way you would create an API.  A person writing a physical system application is going to use a functional language, like LISP/Scheme, or perhaps create their own, like the guys did with Small Talk.  Or if they are writing a Cocoa word processor you would probably use a c style language.  New languages are created when a group is looking to develope an application and there isn't a language that meets their needs.  There may be a couple languages that are close, and then they will put them together.  
In the case of Java's developement, it was created because there was a need for a cross platform language, with high portability.  There was already C++, but no one had created extensions of it to allow complilers on different OS's to read the code the same.  So, Java used, for the most part, a c++ syntax, and added their own primitive functions to allow for portability.  
This is one of the reasons I am not really buying into this D programming language right now, it doesn't fill a need at the moment.  Here is one of their descriptions for who should use it:


> Those who decide the promise of C++ object oriented programming is not fulfilled due to the complexity of it.



I am sorry, but C++ is not THAT complex. Maybe some of the techniques, but not the language.  The hardest thing i can think of is memory management, which is still not that hard.  Is it really that hard to remember to "delete" and object when you are done with it?

Anyway, this is just my little ranting.  Feel free to flame me =)


----------



## anarchie (Dec 21, 2002)

Actually, memory management in C++ is quite confusing compared to plain C, due to the ability to pass objects by reference, and allocate temporary objects on the stack.  This requires you to copy every object you find, lest your caller pass you an object in his stack frame and return later.  On the other hand, Java's, C#'s, and D's garbage collection absolves most memory problems, at the cost of CPU cycles for finding and deleting unused objects.  A good compromise between the two is Objective-C's memory model, where objects are always allocated in the heap, and implement manual reference counting as well as deferred deallocation via autorelease.


----------



## jazz (Dec 21, 2002)

I do like Objective-c's garbage collection, and, i would use it more if it didn't lack a few features of c++.  Which is the reason i write most of my cocoa in obj-c++.

Anyway, this D language falls well short of what i had liked it to be.  Not to mention, you can have the greatest language in the world, but without a descent compiler, it's useless.  The optimizations that gnu has made to their compilers (and SUN) make it not worth using this D. (optimizations via, -O2).  The elimination of nop's and useless branching is quite remarkable.  Because c and c++ are so closely tied to the assembly they break down into, I don't foresee languages getting too abstract, because the more abstract the high level language, the less control you have over the assembly.


----------



## LordCoven (Jan 5, 2003)

There are two things to say about it as far as I'm concerned.

1) Its obviously not impossible given the very large number of successful projects written in C++

2) Its a pain in the arse and the reason why I much prefer writing in Java than in C++. And its not just me.

But like someone mentioned earlier, the language should suite the project. There are instances where you just have to have the low level access you can get from C++ (or C) ... but personally, in all other instances (that is, where I don't require the low level acccess) I'd go with Java (or maybe Objective-C for OS X only projects) every time.

Just 2¢ worth.

C


----------

