Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 03, 2006 D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
I started a new thread for this: "Mike Capp" <mike.capp@gmail.com> wrote in message news:dua67i$12cr$1@digitaldaemon.com... > 7. D has all (well, most of) the power of C++ I see this often and am a bit perplexed by it. What power do you feel is missing? And what about the missing power in C++ - inline assembler, nested functions, contract programming, unit testing, automatic documentation generation, static if, delegates, dynamic closures, inner classes, modules, garbage collection, scope guard? What does D have to do to have more power than C++? |
March 03, 2006 Re: D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > I started a new thread for this: > > "Mike Capp" <mike.capp@gmail.com> wrote in message news:dua67i$12cr$1@digitaldaemon.com... > >>7. D has all (well, most of) the power of C++ > > > I see this often and am a bit perplexed by it. What power do you feel is missing? Something with templates :) You know the thing that starts with implicit ... Another power that is missing is the power of standard library. > > And what about the missing power in C++ - inline assembler, nested functions, contract programming, unit testing, automatic documentation generation, static if, delegates, dynamic closures, inner classes, modules, garbage collection, scope guard? I agree, all these things are missing from C++. > > What does D have to do to have more power than C++? > Fix isues, better std library, added std template library. |
March 03, 2006 Re: D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | Ivan Senji wrote:
> Walter Bright wrote:
>> I started a new thread for this:
>>
>> "Mike Capp" <mike.capp@gmail.com> wrote in message news:dua67i$12cr$1@digitaldaemon.com...
>>
>>> 7. D has all (well, most of) the power of C++
>>
>>
>> I see this often and am a bit perplexed by it. What power do you feel is missing?
>
> Something with templates :)
> You know the thing that starts with implicit ...
>
> Another power that is missing is the power of standard library.
>
>>
>> And what about the missing power in C++ - inline assembler, nested functions, contract programming, unit testing, automatic documentation generation, static if, delegates, dynamic closures, inner classes, modules, garbage collection, scope guard?
>
> I agree, all these things are missing from C++.
>
>>
>> What does D have to do to have more power than C++?
>
> Fix isues, better std library, added std template library.
>
Walter, how technologically complex is implicit template instantiation? I think the consensus
here is that that is the next feature that everyone wants. I guess my question is, why did you go through the regex debacle, instead of working on ITI.
|
March 03, 2006 Re: D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote: > I started a new thread for this: > > "Mike Capp" <mike.capp@gmail.com> wrote in message news:dua67i$12cr$1@digitaldaemon.com... >> 7. D has all (well, most of) the power of C++ > > I see this often and am a bit perplexed by it. What power do you feel is missing? > > And what about the missing power in C++ - inline assembler, nested functions, contract programming, unit testing, automatic documentation generation, static if, delegates, dynamic closures, inner classes, modules, garbage collection, scope guard? C++ has marginal inline asm support, even though no one supports the official syntax :-) Much of the rest I'd consider unimportant as it doesn't impact what's possible in D so much as how easy it is to accomplish a task or how easy it is to verify that the solution is correct. Some language advantages I think D has over C++ are: - delegates - dynamic closures - scope guard - volatile (and therefore some support for concurrency) - synchronized (syntactic sugar but for its implications on language support for concurrency, much like volatile) - inner classes (don't use them, but they are something C++ doesn't do) - modules - garbage collection (arguably an advantage as this can be accomplished in C++ by overriding global operators new/delete) > What does D have to do to have more power than C++? Better RTTI might be nice perhaps. But frankly, I think the power is already there. What D needs to do now is prove itself. Sean |
March 03, 2006 Re: D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | Ivan Senji wrote: > Walter Bright wrote: >> I started a new thread for this: >> >> "Mike Capp" <mike.capp@gmail.com> wrote in message news:dua67i$12cr$1@digitaldaemon.com... >> >>> 7. D has all (well, most of) the power of C++ >> >> >> I see this often and am a bit perplexed by it. What power do you feel is missing? > > Something with templates :) > You know the thing that starts with implicit ... Oh, forgot about that one :-) But as that seems to be a feature due by 1.0 I won't count it. > Another power that is missing is the power of standard library. That's not a language issue though. To me, when comparing the relative 'power' of languages I'd rather just focus on what's possible in the language rather than what's been done. Sean |
March 03, 2006 Re: D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sean Kelly | Sean Kelly wrote:
>
>> What does D have to do to have more power than C++?
>
> Better RTTI might be nice perhaps.
Dynamic module/class loading would be nice as well. This is one of the few features of Java that I wish was present in other languages. DDL is getting there, but that's not quite the same as 'official' support.
Sean
|
March 03, 2006 Re: D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright Attachments: | Walter Bright schrieb am 2006-03-03: > I started a new thread for this: > > "Mike Capp" <mike.capp@gmail.com> wrote in message news:dua67i$12cr$1@digitaldaemon.com... >> 7. D has all (well, most of) the power of C++ > > I see this often and am a bit perplexed by it. What power do you feel is missing? > > And what about the missing power in C++ - inline assembler, nested functions, contract programming, unit testing, automatic documentation generation, static if, delegates, dynamic closures, inner classes, modules, garbage collection, scope guard? > > What does D have to do to have more power than C++? 0) Stockpiles of projects / code - just like C++. 1) standard A standard instead of a "blah, blah, blah" documentation. (-> http://www.digitalmars.com/d/float.html) Enumerating statements in the documentation might be a start. 2) lib A decent standard lib. Decent isn't necessarily large, but useful, structured, documented and working. std.string.tolower/toupper corrupts input: toupper(tolower("a\u1000B")) 3) compiler C++ is available on how many architectures and OSs right now? 4) IDE support / tool chain <no comment> Granted there are some rough corners in the D feature collection, but I don't think that they are THE problem. Thomas |
March 03, 2006 Re: D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | In article <duab09$1arn$1@digitaldaemon.com>, Walter Bright says... > >I started a new thread for this: > >"Mike Capp" <mike.capp@gmail.com> wrote in message news:dua67i$12cr$1@digitaldaemon.com... >> 7. D has all (well, most of) the power of C++ > >I see this often and am a bit perplexed by it. What power do you feel is missing? > >And what about the missing power in C++ - inline assembler, nested functions, contract programming, unit testing, automatic documentation generation, static if, delegates, dynamic closures, inner classes, modules, garbage collection, scope guard? > >What does D have to do to have more power than C++? > > compile time reflection/metaprotocol suport for the win. |
March 03, 2006 Re: D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | In article <duab09$1arn$1@digitaldaemon.com>, Walter Bright says... > >I started a new thread for this: > >"Mike Capp" <mike.capp@gmail.com> wrote in message news:dua67i$12cr$1@digitaldaemon.com... >> 7. D has all (well, most of) the power of C++ > >I see this often and am a bit perplexed by it. What power do you feel is missing? Clean, composable, deterministic resource management. I know C++ is a horrific Frankenstein's monster of a language, but it allows you to encapsulate resource management better than anything I've ever seen. I find this frustrating, because it's not as if D is far off. It might be that auto class members are all that's needed. But I've ranted this rant many times before on this NG, and nobody else seems particularly interested, so I won't repeat it here. Oddly, I don't really agree with most of the other replies. Standard library - meh. I'm not that impressed by the C++ standard library. It's terribly terribly clever, but not actually all that useful relative to the price you pay for using it. IDEs/toolchains - as I just said in another post, none of these offer much more than a decent text editor, and they're downright embarrassing compared to what's available for C# and Java. Libraries - nah. With no ABI, C++ is dead in the water as a modular programming language. Personally I don't use any C++ libs that don't come wrapped in C APIs. >And what about the missing power in C++ - inline assembler, nested functions, contract programming, unit testing, automatic documentation generation, static if, delegates, dynamic closures, inner classes, modules, garbage collection, scope guard? Oh, I don't dispute any of that. Nested functions are great. The contract stuff is pretty good. The unit testing isn't quite the way I'd want it, but I've had a peek at the Phobos guts and it wouldn't take much to get there. Delegates and scopeguard are both very nice. Modules and static if, hallelujah. GC, fine as far as it goes. (The current GC is severely suboptimal, and making it better will break other stuff. And I still get very annoyed by the claim that GC is 'optional' in D.) I'm happy to grant that on balance, maturity issues aside, D is more powerful than C++. But that's not really the point. If you're trying to convince someone with a substantial investment in C++ to switch to D, one of the most important questions you want them to be asking is "What do I have to lose?". The conclusion you want them to come to is "Nothing". If instead the immediate and vehement answer is "Well, THIS!", you've suddenly lost a lot of momentum. That's all I was getting at. Drifting off-topic: in my not-very-original opinion, the killer app for the Next Big Systems Programming Language will be the ability to take advantage of multi-core hardware. (Almost certainly through some sort of functional approach with compiler-verifiable restrictions.) C++ at this point is constitutionally incapable of making that leap. It'll be interesting to see whether D can. cheers, Mike |
March 03, 2006 Re: D - more or less power than C++? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | >> 7. D has all (well, most of) the power of C++ > > I see this often and am a bit perplexed by it. What power do you feel is missing? > > And what about the missing power in C++ - inline assembler, nested functions, contract programming, unit testing, automatic documentation generation, static if, delegates, dynamic closures, inner classes, modules, garbage collection, scope guard? > > What does D have to do to have more power than C++? 1) C++ has ctors/dtors for stack allocated objects. This problem is known in D as luck of struct ctor/dtor. 2) C++/C both have const. These two are corner stones in C++ (among others). The whole std:: namespace without them is just impossible. I cannot imagine serious *library* design without 'const' for example. Library here means design of robust code used by millions. Phobos imho will never be considered as something rock-solid without 'const'. You can add as many features (really nice ones, btw) on top of C syntax but these two are so principal and widely used that without them C++ crowd will not even think about D. Tons of existing code around them. For me personally D is definitely more suitable than C++ for e.g. UI programming in many areas. But not in all. E.g. I have tried three or four different approaches to reproduce string value type in D. Just no way. Everything what I've seen so far is non-comparable with even std:string and I am yet silent about .NET and Java. Big picture: templates (at some extent) and definitely delegates are superior in D than in C++. Other features are more or less elegantly reproducible in C++. D used to have clean,consistent and simple syntax and execution model (e.g. GC "from the shelf") but holes 1) and 2) on the bottom of this ship are just shining. IMHO. Andrew. http://terrainformatica.com |
Copyright © 1999-2021 by the D Language Foundation