www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - what sets (or WILL set) D apart from C/C++?

reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
i won't lie to you, i love D.  i wish i could just convert all my projects
over from C++ and start using it exclusively.

however recently i found something on a forum somewhere, where basically
someone made that statement that right now, D is "just another way to call C
functions."

granted, D isn't even finished yet, and with the lack of "for D" stuff
compared to "for C/C++" stuff, it's not surprising that we have to use all
the stuff made "for C".  but i'm somewhat inclined to agree with them in a
broader sense.

D is very C++ like, unsurprisingly.  it is an evolution of C++.  but how
much of an evolution?

C++ of course is set apart from C for one major reason - OOP and everything
that goes with it.  not to mention it fixes some little stupid things in C
(certain syntaxes and whatnot).  but what is so different about D to set it
apart from C++ as "the next step"?  sure, it's laid out in a more intuitive
way, it removes some stupidities of C++ (*^%$&$ FORWARD DECLARATIONS), it
simplifies certain basic data handling - but what REALLY makes it worthy of
being D and not C+=2 ?  ;)

maybe the simplicity and rethought is enough.  of course the fact that it's
not backwards compatible for the most part makes it a separate language ;)

but what are your thoughts?  do you think that D is enough to be a successor
to C++?  is it a nice little accompaniment?  or has it yet to recieve the
final blow if you will that will make it *truly* a proper successor to C++?
Jul 10 2004
next sibling parent Matthias Becker <Matthias_member pathlink.com> writes:
i won't lie to you, i love D.  i wish i could just convert all my projects
over from C++ and start using it exclusively.

however recently i found something on a forum somewhere, where basically
someone made that statement that right now, D is "just another way to call C
functions."

granted, D isn't even finished yet, and with the lack of "for D" stuff
compared to "for C/C++" stuff, it's not surprising that we have to use all
the stuff made "for C".  but i'm somewhat inclined to agree with them in a
broader sense.

D is very C++ like, unsurprisingly.  it is an evolution of C++.  but how
much of an evolution?

C++ of course is set apart from C for one major reason - OOP and everything
that goes with it.  not to mention it fixes some little stupid things in C
(certain syntaxes and whatnot).  but what is so different about D to set it
apart from C++ as "the next step"?  sure, it's laid out in a more intuitive
way, it removes some stupidities of C++ (*^%$&$ FORWARD DECLARATIONS), it
simplifies certain basic data handling - but what REALLY makes it worthy of
being D and not C+=2 ?  ;)

maybe the simplicity and rethought is enough.  of course the fact that it's
not backwards compatible for the most part makes it a separate language ;)

but what are your thoughts?  do you think that D is enough to be a successor
to C++?  is it a nice little accompaniment?  or has it yet to recieve the
final blow if you will that will make it *truly* a proper successor to C++?

Yes, good point. D has some small thinks that you miss in C++. But it's still very close. It has some nice things like lambda expressions (called Function literals) and nested functions which is very cool, as it helps a lot in programming a bit functional. But to set D realy appart we'd need some interesting things perhaps from other paradigms, like functional or logical prgramming. OK, I don't know very much about the logical paradigm, but what I kow so far looks pretty cool, but I have no idea how to put this in a language like D. I've heard JMatch is a Java-Exteions that just doe that. Perhaps it's worth looking at it. But as Walter seems not to be intereted in functional or logical programming the chance that we get fatures like this is small.
Jul 10 2004
prev sibling next sibling parent reply Andy Friesen <andy ikagames.com> writes:
Jarrett Billingsley wrote:
 i won't lie to you, i love D.  i wish i could just convert all my projects
 over from C++ and start using it exclusively.
 
 however recently i found something on a forum somewhere, where basically
 someone made that statement that right now, D is "just another way to call C
 functions."
 
 granted, D isn't even finished yet, and with the lack of "for D" stuff
 compared to "for C/C++" stuff, it's not surprising that we have to use all
 the stuff made "for C".  but i'm somewhat inclined to agree with them in a
 broader sense.
 
 D is very C++ like, unsurprisingly.  it is an evolution of C++.  but how
 much of an evolution?
 
 C++ of course is set apart from C for one major reason - OOP and everything
 that goes with it.  not to mention it fixes some little stupid things in C
 (certain syntaxes and whatnot).  but what is so different about D to set it
 apart from C++ as "the next step"?  sure, it's laid out in a more intuitive
 way, it removes some stupidities of C++ (*^%$&$ FORWARD DECLARATIONS), it
 simplifies certain basic data handling - but what REALLY makes it worthy of
 being D and not C+=2 ?  ;)
 
 maybe the simplicity and rethought is enough.  of course the fact that it's
 not backwards compatible for the most part makes it a separate language ;)
 
 but what are your thoughts?  do you think that D is enough to be a successor
 to C++?  is it a nice little accompaniment?  or has it yet to recieve the
 final blow if you will that will make it *truly* a proper successor to C++?

D has lots and lots and lots of little nuances that are just plain nice to have. Most of those little things don't mean much, but it doesn't take long before they add up. Really, though, if you look at every successful language over the past 10-20 years, the ones that stuck around tended to be the ones that borrow bits and pieces of everything from other languages. (including C++) I think the pivotal aspect will be the tools. I spent some time playing with MS's new C# Express beta, and the editor alone made a boring, crippled language easy, even fun, to write. (particularly the refactoring tools) Visual C++ pales in comparison, and the complexity of the language lends little hope for it ever catching up. Maybe an Eclipse plugin is a bigger deal than it looks at first glance. :) -- andy
Jul 10 2004
next sibling parent reply "David Barrett" <dbarrett quinthar.com> writes:
"Andy Friesen" <andy ikagames.com> wrote in message
news:ccp9ii$135u$1 digitaldaemon.com...
 I think the pivotal aspect will be the tools.  I spent some time playing
 with MS's new C# Express beta, and the editor alone made a boring,
 crippled language easy, even fun, to write. (particularly the
 refactoring tools) Visual C++ pales in comparison, and the complexity of
 the language lends little hope for it ever catching up.

Speaking of tools, I think a great D feature is it's ability to work with HTML seamlessly. I'd like to see what an IDE could do with this. Screw Doxygen -- just make the source code and the documentation the same thing! Embed UML state diagrams right into comments. Create RSS feeds for file changes. Who knows, but I think there are some cool possibilities that would be hard to match with other languages. -david
Jul 10 2004
next sibling parent reply Ben Hinkle <bhinkle4 juno.com> writes:
David Barrett wrote:

 "Andy Friesen" <andy ikagames.com> wrote in message
 news:ccp9ii$135u$1 digitaldaemon.com...
 I think the pivotal aspect will be the tools.  I spent some time playing
 with MS's new C# Express beta, and the editor alone made a boring,
 crippled language easy, even fun, to write. (particularly the
 refactoring tools) Visual C++ pales in comparison, and the complexity of
 the language lends little hope for it ever catching up.

Speaking of tools, I think a great D feature is it's ability to work with HTML seamlessly. I'd like to see what an IDE could do with this. Screw Doxygen -- just make the source code and the documentation the same thing! Embed UML state diagrams right into comments. Create RSS feeds for file changes. Who knows, but I think there are some cool possibilities that would be hard to match with other languages. -david

Has anyone really tried using the HTML feature? The example dmd/samples/d/hello2.html isn't a great example (IMHO) since the code has html tags to turn parts of it blue and working with code in a text editor that has the coloring *built-in* to the file is nasty; instead the coloring should be done by the editor and some style-guides. I'd rather see an example where the HTML stuff is used for the comments and the code remains pure text. Another advantage of doxygen is that it creates all the hyperlinks and cross-referencing automatically so you don't have to do it all by hand. On a related topic has anyone tried Knuth's "literate programming"? It also mixes documenting the code with the code itself. Looks pretty wierd, though. Having edited tex.web by hand it can be pretty grueling to debug.
Jul 10 2004
parent J C Calvarese <jcc7 cox.net> writes:
Ben Hinkle wrote:
 David Barrett wrote:
 
 
"Andy Friesen" <andy ikagames.com> wrote in message
news:ccp9ii$135u$1 digitaldaemon.com...

I think the pivotal aspect will be the tools.  I spent some time playing
with MS's new C# Express beta, and the editor alone made a boring,
crippled language easy, even fun, to write. (particularly the
refactoring tools) Visual C++ pales in comparison, and the complexity of
the language lends little hope for it ever catching up.

Speaking of tools, I think a great D feature is it's ability to work with HTML seamlessly. I'd like to see what an IDE could do with this. Screw Doxygen -- just make the source code and the documentation the same thing! Embed UML state diagrams right into comments. Create RSS feeds for file changes. Who knows, but I think there are some cool possibilities that would be hard to match with other languages. -david

Has anyone really tried using the HTML feature? The example dmd/samples/d/hello2.html isn't a great example (IMHO) since the code has html tags to turn parts of it blue and working with code in a text editor that has the coloring *built-in* to the file is nasty; instead the coloring should be done by the editor and some style-guides. I'd rather see an example where the HTML stuff is used for the comments and the code remains pure text. Another advantage of doxygen is that it creates all the hyperlinks and cross-referencing automatically so you don't have to do it all by hand.

Actually, I've used DMD to compile quite a few HTML files -- mostly just for fun. Some of the stuff gets tedious when coding by hand, but it's not a big deal to get a tool to generated HTML. I've ported Pavel's D2HTML from the early days of D to PHP for the tutorials at dsource. Each example page should be compilable just by adding .html to the filename and sending to DMD. Seems like a neat trick to me. -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Jul 17 2004
prev sibling parent reply "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
"David Barrett" <dbarrett quinthar.com> wrote in message
news:ccphb7$1dsr$1 digitaldaemon.com...
 "Andy Friesen" <andy ikagames.com> wrote in message
 news:ccp9ii$135u$1 digitaldaemon.com...
 I think the pivotal aspect will be the tools.  I spent some time playing
 with MS's new C# Express beta, and the editor alone made a boring,
 crippled language easy, even fun, to write. (particularly the
 refactoring tools) Visual C++ pales in comparison, and the complexity of
 the language lends little hope for it ever catching up.

Speaking of tools, I think a great D feature is it's ability to work with HTML seamlessly. I'd like to see what an IDE could do with this. Screw Doxygen -- just make the source code and the documentation the same thing! Embed UML state diagrams right into comments. Create RSS feeds for file changes. Who knows, but I think there are some cool possibilities that would be hard to match with other languages.

Can you give a 1-para synopsis of RSS for an old thickie?
Jul 10 2004
parent reply "David Barrett" <dbarrett quinthar.com> writes:
"Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message
news:ccptp5$20ei$1 digitaldaemon.com...
 "David Barrett" <dbarrett quinthar.com> wrote in message
 news:ccphb7$1dsr$1 digitaldaemon.com...
 "Andy Friesen" <andy ikagames.com> wrote in message
 news:ccp9ii$135u$1 digitaldaemon.com...
 I think the pivotal aspect will be the tools.  I spent some time



 with MS's new C# Express beta, and the editor alone made a boring,
 crippled language easy, even fun, to write. (particularly the
 refactoring tools) Visual C++ pales in comparison, and the complexity



 the language lends little hope for it ever catching up.

Speaking of tools, I think a great D feature is it's ability to work


 HTML seamlessly.  I'd like to see what an IDE could do with this.  Screw
 Doxygen -- just make the source code and the documentation the same


 Embed UML state diagrams right into comments.  Create RSS feeds for file
 changes.  Who knows, but I think there are some cool possibilities that
 would be hard to match with other languages.

Can you give a 1-para synopsis of RSS for an old thickie?

I don't know too much about it, but it's basically a standardized format (using XML, I think) to publish tidbits of information, like blogs or news headlines. So, a Blog might have an "RSS Feed", which is just an XML formatted-version of the blog that can be downloaded and parsed by an RSS-reader (just like HTML is downloaded and parsed by a Web browser). Anyway, I was thinking somehow D, or Subversion, or some IDE, or some combination of all three could publish RSS feeds on a per-method/class/module basis, and then using standard RSS readers you could keep up to date on what has changed. You could subscribe to whichever feeds you were interested in (such as whichever libraries and modules you use). I think there are some scripts to generate RSS feeds from CVS checkins; I really don't know much about it. -david
Jul 11 2004
parent reply Brad Anderson <brad dsource.dot.org> writes:
Subversion, much like CVS has hooks that you can program to execute 
utilities when certain events occur.  If there's enough interest, I'll 
throw something together for dsource.org.

BA

David Barrett wrote:
 
 I don't know too much about it, but it's basically a standardized format
 (using XML, I think) to publish tidbits of information, like blogs or news
 headlines.   So, a Blog might have an "RSS Feed", which is just an XML
 formatted-version of the blog that can be downloaded and parsed by an
 RSS-reader (just like HTML is downloaded and parsed by a Web browser).
 
 Anyway, I was thinking somehow D, or Subversion, or some IDE, or some
 combination of all three could publish RSS feeds on a
 per-method/class/module basis, and then using standard RSS readers you could
 keep up to date on what has changed.  You could subscribe to whichever feeds
 you were interested in (such as whichever libraries and modules you use).
 
 I think there are some scripts to generate RSS feeds from CVS checkins; I
 really don't know much about it.
 
 -david
 
 

Jul 12 2004
parent "David Barrett" <dbarrett quinthar.com> writes:
I think that would be most useful for a team of D programmers.  I'm just
doing it solo, and only experimenting at that, so it wouldn't be useful for
me yet.  Thanks for offering, however.

-david

"Brad Anderson" <brad dsource.dot.org> wrote in message
news:ccu60f$1tvn$1 digitaldaemon.com...
 Subversion, much like CVS has hooks that you can program to execute
 utilities when certain events occur.  If there's enough interest, I'll
 throw something together for dsource.org.

 BA

 David Barrett wrote:
 I don't know too much about it, but it's basically a standardized format
 (using XML, I think) to publish tidbits of information, like blogs or


 headlines.   So, a Blog might have an "RSS Feed", which is just an XML
 formatted-version of the blog that can be downloaded and parsed by an
 RSS-reader (just like HTML is downloaded and parsed by a Web browser).

 Anyway, I was thinking somehow D, or Subversion, or some IDE, or some
 combination of all three could publish RSS feeds on a
 per-method/class/module basis, and then using standard RSS readers you


 keep up to date on what has changed.  You could subscribe to whichever


 you were interested in (such as whichever libraries and modules you


 I think there are some scripts to generate RSS feeds from CVS checkins;


 really don't know much about it.

 -david


Jul 12 2004
prev sibling parent teqDruid <me teqdruid.com> writes:
On Sat, 10 Jul 2004 10:42:30 -0700, Andy Friesen wrote:
 
 Maybe an Eclipse plugin is a bigger deal than it looks at first glance. :)
 
   -- andy

Was that an offer to do some coding on eclipseD? (It still needs a good code formatter... and an bloody icon...)
Jul 10 2004
prev sibling next sibling parent "Matthew" <admin stlsoft.dot.dot.dot.dot.org> writes:
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message
news:ccp18i$m9s$1 digitaldaemon.com...
 i won't lie to you, i love D.  i wish i could just convert all my projects
 over from C++ and start using it exclusively.

 however recently i found something on a forum somewhere, where basically
 someone made that statement that right now, D is "just another way to call C
 functions."

What's wrong with that? IMO, that's what every language should be, and one of the reasons why Java is a dead dog, and Ruby and Python are preferable to Perl.
 granted, D isn't even finished yet, and with the lack of "for D" stuff
 compared to "for C/C++" stuff, it's not surprising that we have to use all
 the stuff made "for C".  but i'm somewhat inclined to agree with them in a
 broader sense.

 D is very C++ like, unsurprisingly.  it is an evolution of C++.  but how
 much of an evolution?

 C++ of course is set apart from C for one major reason - OOP and everything
 that goes with it.  not to mention it fixes some little stupid things in C
 (certain syntaxes and whatnot).  but what is so different about D to set it
 apart from C++ as "the next step"?  sure, it's laid out in a more intuitive
 way, it removes some stupidities of C++ (*^%$&$ FORWARD DECLARATIONS), it
 simplifies certain basic data handling - but what REALLY makes it worthy of
 being D and not C+=2 ?  ;)

- D doesn't have Return Value Lifetime issues. - D obviates instance slicing problem - D reduces the amount of operator abuse possible (although that's creeping in) - D provides array slices. - D uses modules rather than the inclusion model That mind not sound much, but it's actually a great deal. AFAICT - which is not far at this time of the morning - everything else is pretty much syntax. But I still think these 5 + syntax represent a big win.
 maybe the simplicity and rethought is enough.  of course the fact that it's
 not backwards compatible for the most part makes it a separate language ;)

Let's look at it another way. I've ingested so much C++ over the last 13 yrs or so that I think I can claim to be reasonably good at it. However, I still have a mental fog when I look at some other people's code, and that's not just because most people are sloppy as all hell when it comes to their code layout. It's the complexity of the language. But C++ is so powerful (including the ad/mis-use of many of its flaws) that I don't see me giving it up, ever. However, most times I've been asked in the last couple of years what language I would recommend someone to learn, when they want to understand compiled languages, "C++" or ".NET", I've responded "D".
 but what are your thoughts?  do you think that D is enough to be a successor
 to C++?

No
  is it a nice little accompaniment?

Rather it's a powerful language in its own right, with a big future ahead of it.
  or has it yet to recieve the
 final blow if you will that will make it *truly* a proper successor to C++?

Nope. I think C++ has a long lifetime ahead of it, despite its flaws and complexity. Why should D have to replace C++ to be a success? Java didn't kill C++ - far from it - and yet we could still call Java a success. (In a commercial sense, of course, not technically!) C#/.NET isn't going to do it. Why should D have to/want to? I'll give you an example. At the moment, I'm writing a compiler multiplexer tool that will go on the CD for my book (http://imperfectcplusplus.com/). Walter asked me last week why I wasn't writing it in D. There are several reasons. The multiplexer must be portable to most/all operating systems. It must be ready now, and D isn't. It itself must be compilable by most/all C++ compilers on a range of operating systems. Its implementation can leverage off several non-trivial C/C++ libraries (including STLSoft, recls, Open-RJ, Boost. etc. etc. But, relating this back to your earlier "Is D a wrapper for C" comment, it has a pluggable architecture. One can specify input and/or output filters as Perl/Python/Ruby/whatever-else-you-want scripts (maybe D script in the future??), or its own rules file syntax, or as separate executables, or as dynamic libraries. The dynamic libraries have a C-interface, of course, but use the Portable Vtables technique I describe in the book such that one can effectively share C++ classes across modules built with different compilers. There's no reason why one cannot write the plug-in executables or dynamic libraries in D, and I certainly plan to do that. Anyway, here's the point. Some of the example executable/dynamic-library filters are written in C++. But they've been a total PITA to do so, compared with the filters I've written in Python/Perl/Ruby, as you'd expect: compare development times of several hours with about 15 minutes. But some C/C++ compilers have weird idiosynchracies with their command-lines (e.g. CodeWarrior requires a "-I-" _before_ any other "-I???") that means that scripting languages are less suitable than a compiled language. Given the fact that string manipulation is a dream in D, coupled with the fact that its got regexp built-in, means that it'll be my language of choice for those filters that are not amenable to scripting. So, to me, D is the best language when the total, manic grunt of C++ is not required, but a less powerful language (e.g. scripting language, or one of the VM languages) is not suitable. (Imagine how slow it would be to compile a file with 10 different compilers if the input and output filtering was done by Java/.NET classes - what a joke!) Anyway, if that's turned out to be a huge plug for my book, I'm sorry. It didn't turn out like that, but my attention is necessarily influenced at the moment. =P The other major advantage of C++ over any other language at the moment is its support for high efficiency and generic programming. I expect D will catch up with C++, and perhaps even surpass it in this regard - and I intend to put in a big effort in the near future to that end! - but at the moment they don't compare. </end of rant> Cheers -- Matthew Wilson Author: "Imperfect C++", Addison-Wesley, 2004 (http://www.imperfectcplusplus.com) Contributing editor, C/C++ Users Journal (http://www.synesis.com.au/articles.html#columns) Director, Synesis Software (www.synesis.com.au) STLSoft moderator (http://www.stlsoft.org) -----------------------------------------------------
Jul 10 2004
prev sibling next sibling parent reply John Reimer <brk_650 NO_SPA_M.yahoo.com> writes:
Jarrett Billingsley wrote:

<snip>

 D is very C++ like, unsurprisingly.  it is an evolution of C++.  but how
 much of an evolution?
 

<snip> That's funny... I don't find D very similar to C++ at all. About the only thing that they share extraordinarily in common is their C heritage. I've never liked C++. It may be a powerful and expressive language... but what a pain to work with. It seems that the reason that it has so many specialized tools these days is likely for the poor programmer's that need to make sense of convoluted c++ code (viusal IDE's, etc.) Also the heavy use of pre-processor macros in C++ annoys me. I've looked at several GUI toolkit's (eg, fox and wxWidget) and find that they all MUST use macros in order to make the messaging system work (MFC also did that too, IIRC). Apparently C++ is significantly handicapped without the macros. Go figure! That's ugly, ugly, ugly.... and all in the name of power and flexibility. I'll leave C++ to the intellectuals... or those that fancy themselvs as such. If I'm going to devote my wee brain to learning a language, I'll try to stick to those that allow me apply a few more brain cells to the algorithm at hand. Later, John
Jul 10 2004
parent Mista <stoop hotpop.com> writes:
John Reimer wrote:
 Jarrett Billingsley wrote:
 
 <snip>
 
D is very C++ like, unsurprisingly.  it is an evolution of C++.  but how
much of an evolution?

<snip> That's funny... I don't find D very similar to C++ at all. About the only thing that they share extraordinarily in common is their C heritage. I've never liked C++. It may be a powerful and expressive language... but what a pain to work with. It seems that the reason that it has so many specialized tools these days is likely for the poor programmer's that need to make sense of convoluted c++ code (viusal IDE's, etc.) Also the heavy use of pre-processor macros in C++ annoys me. I've looked at several GUI toolkit's (eg, fox and wxWidget) and find that they all MUST use macros in order to make the messaging system work (MFC also did that too, IIRC). Apparently C++ is significantly handicapped without the macros. Go figure! That's ugly, ugly, ugly.... and all in the name of power and flexibility. I'll leave C++ to the intellectuals... or those that fancy themselvs as such. If I'm going to devote my wee brain to learning a language, I'll try to stick to those that allow me apply a few more brain cells to the algorithm at hand. Later, John

I agree. D is so much easier to learn and use, in my eye's that is what makes it so much better then C++. Many C++ worshippers might not want to change to D. But for newly started programmers and for the people that always hated/disliked C++, D might turn out to become their favorate choice. Time will tell, but i am a beleiver :)
Jul 10 2004
prev sibling parent Russ Lewis <spamhole-2001-07-16 deming-os.org> writes:
In my opinion, there is not any single, huge feature in D that makes it 
better than C++.  Yet there are an abundance of little features that 
make things easier, including:

* Garbage collection
* Native support for arrays
* Delegates
* Function literals
* "import" instead of "include"
* No need to have separate .c and .h files
etc...

D's great strength is that a C++ programmer can pick it up in an 
afternoon and dabble with it a bit.  He doesn't have to go take a class, 
or read volumes of documentation, to understand the code.  D is so close 
to C++ that the jump is easy to make.

Yet, once you've used D, it's really hard to go back to C++.  All those 
little tiny features suddenly seem like glaring flaws in C++.

I had the same experience with going back to C after using C++.  The two 
big things I remembered were the fact that you couldn't declare 
variables midway in your function (in C, you have to declare them at the 
top of a block) and that you always had to use the "struct" prefix in 
front of struct typenames.  These are TINY things.  But after using C++, 
I was irritated to have to go back to C and live without these things.

I suspect it will be the same way with D.  I don't expect D to "kill 
C++" or anything like that.  But I do expect there to be a slow, steady 
stream of programmers moving from C++ to D.  I don't expect that many of 
them will want to move back.

Russ
Jul 11 2004