Valhalla Legends Archive

Programming => General Programming => Topic started by: Mephisto on June 17, 2005, 02:02 AM

Title: D Programming Language
Post by: Mephisto on June 17, 2005, 02:02 AM
I heard people talking about D and I Googled it.  Apparantly it's an improved version of C++ (obviously from the name).  My question is that is it really worth using?  Is it used on the corporate/business level as C++ is?  Do gaming and software development companies use it over C++ now?  etc.
Title: Re: D Programming Language
Post by: hierholzer on June 17, 2005, 10:51 AM
Here are some differences between them what they have/ dont have..

http://www.digitalmars.com/d/
Title: Re: D Programming Language
Post by: Mephisto on June 17, 2005, 02:14 PM
Already read that.  That's where I originally discovered the D language.
Title: Re: D Programming Language
Post by: Yegg on June 17, 2005, 05:50 PM
Interesting...
Title: Re: D Programming Language
Post by: Yoni on June 18, 2005, 07:08 AM
My opinion:

1. Don't use it now. Its only compiler (Digital Mars D compiler) is in Alpha and it's still under development. Nothing else supports it and there are no libraries for it.

2. The language looks awesome. It is definitely something to look forward to, as a great replacement (no less!) for C and C++!
Title: Re: D Programming Language
Post by: R.a.B.B.i.T on June 18, 2005, 02:33 PM
That looks awesome!
Title: Re: D Programming Language
Post by: LivedKrad on June 19, 2005, 06:43 PM
Seems a bit out of my scope, I'll stick with learning C# for now.
Title: Re: D Programming Language
Post by: R.a.B.B.i.T on June 19, 2005, 07:47 PM
Ew.
Title: Re: D Programming Language
Post by: shout on June 21, 2005, 11:13 PM
They are getting rid of namespaces??? Why???

This seems kinda ewwy, but I will have to wait until there is something before I can judge it.
Title: Re: D Programming Language
Post by: Yegg on June 22, 2005, 09:15 AM
Maybe they have a better replacement for namespaces. I can't imagine what it would be though...
Title: Re: D Programming Language
Post by: R.a.B.B.i.T on June 23, 2005, 05:27 PM
Namespaces SUCK.
Title: Re: D Programming Language
Post by: shout on June 23, 2005, 11:52 PM
Quote from: rabbit on June 23, 2005, 05:27 PM
Namespaces SUCK.

Elaborate please.
Title: Re: D Programming Language
Post by: tA-Kane on June 24, 2005, 02:57 AM
There are a number of things in the D language that I do not like. I'll list the two which I can remember below. The D language *does* look pretty cool with them aside, however. Please feel free to correct me if you think I'm understanding these statements wrong.

Quotehttp://www.digitalmars.com/d/function.html#nested
There is no inline keyword. The compiler makes the decision whether to inline a function or not
So you cannot specifically specify a specific (whoa... lotta specific, heh!) function to be inlined and instead have to hope that the compiler inlines it? Can you say... eww?

Quotehttp://www.digitalmars.com/d/class.html
The D compiler is free to rearrange the order of fields in a class to optimally pack them in an implementation-defined manner.
That's not right, in my opinion. At the very least, there should be an option to turn that off... otherwise, so much for writing an extensible class which directly reads or writes data to or from the network or your hard drive which is compatible with other (and possibly even already-existing) protocols.

Title: Re: D Programming Language
Post by: Yoni on June 24, 2005, 09:52 AM
Quote from: tA-Kane on June 24, 2005, 02:57 AM
Quotehttp://www.digitalmars.com/d/function.html#nested
There is no inline keyword. The compiler makes the decision whether to inline a function or not
So you cannot specifically specify a specific (whoa... lotta specific, heh!) function to be inlined and instead have to hope that the compiler inlines it? Can you say... eww?
I don't agree. Name a situation where you would want to inline a function that the optimizer wouldn't have inlined automatically.
NOTE: Assume the optimizer is smarter than you.

Quote from: tA-Kane on June 24, 2005, 02:57 AM
Quotehttp://www.digitalmars.com/d/class.html
The D compiler is free to rearrange the order of fields in a class to optimally pack them in an implementation-defined manner.
That's not right, in my opinion. At the very least, there should be an option to turn that off... otherwise, so much for writing an extensible class which directly reads or writes data to or from the network or your hard drive which is compatible with other (and possibly even already-existing) protocols.
That refers to classes. The way I understood it, unlike C++, D treats classes and structs very differently. You would use a struct for what you said, not a class, and write C-style functions which accept struct pointers. That is the "systems programming" way to do it; object-oriented programming is much higher level and there is no cross-language way to implement it, currently. (Specifically, C++ classes are already implementation-defined, just like D's are! For example, every compiler implements multiple inheritence differently.)

Edit: As it says later in the same paragraph:
QuoteExplicit control of field layout is provided by struct/union types, not classes.
Title: Re: D Programming Language
Post by: tA-Kane on June 24, 2005, 05:47 PM
Quote from: Yoni on June 24, 2005, 09:52 AM
Quote from: tA-Kane on June 24, 2005, 02:57 AM
Quotehttp://www.digitalmars.com/d/function.html#nested
There is no inline keyword. The compiler makes the decision whether to inline a function or not
So you cannot specifically specify a specific (whoa... lotta specific, heh!) function to be inlined and instead have to hope that the compiler inlines it? Can you say... eww?
I don't agree. Name a situation where you would want to inline a function that the optimizer wouldn't have inlined automatically.
NOTE: Assume the optimizer is smarter than you.
Without actually extensively testing the D compiler (which I really do not have time for, currently) I cannot provide an example. But I really dislike the idea of not allowing the programmer to specify certain functions to be inlined.
Title: Re: D Programming Language
Post by: Banana fanna fo fanna on June 24, 2005, 08:40 PM
tA-Kane, though I truly believe that the optimizer is better than a human, I see no reason to remove the ability of a programmer to specify inlining.

But that's not enough to keep me from using it. It looks cool.
Title: Protectionist languages
Post by: Kp on June 24, 2005, 08:51 PM
The part that I consider somewhat strange about the removal of the inline keyword is that it has always been advisory in C++.  The compiler is free to ignore your inlining request if the function is too complex, is recursive, or is unsuitable for some more obscure reason.  Given that, it seems quite strange to remove manual inlining.

Besides, I've always held the belief that a language shouldn't prevent you from doing something "stupid" if you really think you need to do so.  That doesn't preclude making it difficult to shoot yourself in the foot (e.g. requiring casts or other constructs to assure the compiler you know what you're doing), but it does preclude entirely removing the ability to shoot yourself in the foot.
Title: Re: D Programming Language
Post by: shout on June 28, 2005, 10:03 AM
Anyway, DUI (http://dui.sourceforge.net/) (Driving Under Influence?)
Quote from: dui.sourceforge.net
DUI is a D language graphical user interface wrapping (or binding) GTK+ graphical toolkit
DUI stands for D graphical User Interface
D can interface with C so any graphics toolkit with a C API can be used directly from D, this includes GTK+.
DUI is released under the LGPL license