A gentle critque..

Dave Dave_member at pathlink.com
Mon May 15 09:36:38 PDT 2006


Ben Cooley wrote:
> In article <e494td$jvc$1 at digitaldaemon.com>, Hasan Aljudy says...
>> I only agree with 2 points: the lack of a rich library, and the lack (so 
>> far) of an IDE, but the lattar is not part of the language per se.
>>
>> Guess what, I came to D because I hated C++.
>> C++ has the worst set of libraries ever. If you compare what C++ has vs. 
>> what Java has, the Java libraries would win anyday!
>> Even if the same library was written for both Java and C++, the Java 
>> version would always win. (look at the ICU library for example).
> 
> I don't disagree.  However it's simply not possible to do any sort of practical
> programming without using these libraries, and it's extremely tedious to have to

I strongly disagree; at least in the environments that I've been working 
in over the past 5 years using C and C++, I could have done a lot of the 
work with D and phobos as-is. What I've been doing in those languages is 
a lot of small "script-like" utilities that need high-performance, and a 
couple of larger server-side projects that use parts of the STL (that 
can be replaced for the most part with D built-ins like first class 
arrays, char[] instead of std::string and AA's). The other DB and 
web-related stuff I've been doing, I wouldn't use C or C++ for anyhow.

D won't take over the world in 'one fell swoop', it's primary initial 
use will be things like the above, and it will be new development and 
not porting of C or C++ code that's already been debugged and in operation.

That said, Walter has taken his ECMAScript implementation and ported 
that from C++ to D. It was done with about 1/2 the source code 
(including non-std libs) and runs about 25% faster. What Walter 
describes here coincides with what I claim above (built-ins obviate the 
need for a lot of C++ library functionality):

http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/28938

Your OP sounds a lot like what I would have said a year and a half ago 
before I started to experiment w/ D in earnest. Now, I see little 
utility in complex "D to X" conversion projects. A conversion utility 
for the most widely used C++ libs. (template based) isn't practical, and 
headers converted using a C to D conversion program would probably 
require as much time to verify as just doing by hand and verifying as 
you go. Besides, with a conversion tool, an opportunity to "refactor" 
old C headers and libs. is lost.

About the only thing I agree with the OP about is that the library is a 
bit sparse. I agree that some more could be added to the std. lib. and 
at the very least the std.c.linux.* (DMD) vs. std.c.unix.* (GDC) issue 
needs to be resolved quickly for portability between the compilers.

And what I see as the most important missing parts of the std. lib. have 
been addressed with mango (IO) and DWT (GUI) once DWT is available for 
Linux. Oh, and probably XML support needs to be added, and there are 
projects addressing that as well.

I see in another post that your OP was predicated on your experience 
with a specific large C++ project in mind. You need to include details 
like that before you post "show stopper" issues for D... In your current 
world they may be show stoppers, but for most of the rest, what you list 
as a show-stopper really isn't.

> wrap each library.  C plus plus is not as clean or as nice to program in as D,
> but at least I don't have to wrap all of the external code that I need to use..
> and the code I write will also be useful to other C/C++ programmers.  That's
> what you're up against here.
> 
> Again.. Java and C# have their own advatages which tend to outweigh some of the
> disadvantages of not having direct and immediate access to system level
> libraries written in C and C++.  Yet D is intended as a system level programming
> languages.  The fact that it can't understand the entire body of system level
> code in C and C plus plus, and it doesn't play nice with C plus plus is a
> serious.. probably fatal.. drawback.  It really doesn't have to be that way
> though.
> 
>> Java and C# succeeded without dealing with any of the C++ crap; C++ 
>> wasn't a show stopper for them.
>> Infact, I bet C++'s stupidity was a recruitment tool for Java and C#. It 
>> can also be a recruitment tool for D.
> 
> It can be.. but I think it's wishful thinking to compare D to C# or java for a
> number of reasons.
> 
> 



More information about the Digitalmars-d mailing list