The purpose of D (GC rant, long)

Walter Bright newshound at digitalmars.com
Thu Oct 26 11:53:05 PDT 2006


I can understand your desire to control memory explicitly. I grew up 
programming C and C++, and considered myself a professional, and 
professionals have complete control over the operation of their 
programs. gc was for lazy, wussy, less competent programmers. I bought 
the conventional wisdom that gc was slow and inefficient.

Then, for a project my employer put me on, I had to use a gc, in fact, I 
had to work on a gc. I slowly came to realize I was wrong about gc on 
all counts.

Then I began to think about why C++ was so complicated. I eventually 
began to realize it's because of explicit memory management. Have a gc, 
and suddenly you can make a language with even greater power that is 
much, much simpler.

For one example, you cannot do array slices in C++ without considerable 
agony. In D, they are easy as pie.

P.S. It *is* true (before D) that gc based languages are slower than 
C/C++. The conventional wisdom says that this is caused by the gc. This 
simply is not true, the slowness is usually caused by lack of 
expressiveness in the language (Java) or dynamic typing (Python, 
Javascript, etc.).



More information about the Digitalmars-d mailing list