why and how D can solve the next software crisis (was Re: Negative)

Kevin Bealer Kevin_member at pathlink.com
Thu Mar 2 21:44:44 PST 2006


In article <du7fo5$1uqo$1 at digitaldaemon.com>, Walter Bright says...
>
>A lot of excellent comments. Some more from me embedded:

Thanks.

>"Kevin Bealer" <Kevin_member at pathlink.com> wrote in message 
>news:du5hbu$2bag$1 at digitaldaemon.com...
>> So the C++ team adds hard-to-implement/use stuff to the language, and 
>> rarely
>> adds easy-to-implement/use stuff, because the easy-to-implement stuff is 
>> doable
>> with macros/template magic.  Macro/template language is much more powerful 
>> than
>> macro-only magic.  But the illusion still breaks down ... everyone has an
>> ITERATE macro that doesnt quite work seamlessly.
>
>Yes, my thoughts exactly.
>
>> I think the crown might pass to any language that could fix C++ 
>> performance and
>> syntax... once it declared for the throne.  D does very well syntactically 
>> and
>> performance wise, but I think it still has the "not ready yet" label stuck 
>> on
>> the front of the box, because of the sub-1.0 version and lack of ... 
>> (insert
>> wishlist items).
>
>The wishlist thing is an ever-growing thing. It's a problem, mostly my 
>fault.

For some reason I always want to write "the only thing on the wishlist I really
care about is...", but then I think of 10 things right away.  When I write here
I tend to write a lot of stuff off the cuff, in a sort of "noone's ever done X,
I wonder if it would be useful..." style.

But:

>> (Question: What was the "trigger" that made people start
>> adopting Java for projects?)
>
>The initial trigger was the idea you could embed Java applets into a web 
>page, coupled with the idea that it was a C++ like language that was, in 
>contrast, easilly mastered. 

You and Ianc wrote about this side of it, and it makes sense now - I have been
thinking of Java strictly in terms of language design.

Now I realize something..

Business people, and for that matter, most other people, tend to explain their
own logic (and history itself) via "narratives".  Everyone used X, but then
problem Y happened.  Language Z came along and solved this.  Political movement
X was replaced by movement Y when World War Z occurred.  Cause->Effect.

But the original rationale rarely stays put.  C was for systems programming (but
took over everything).  Java was designed for the web, but now is used for
desktop applications, etc.  Computers originally were marketed for the home on
the rationale that they can manage recipes for dishes.

So... from this kind of marketing point of view, what problems are just over the
horizon that D can get ahead of the curve on?  It's very good at what C, C++,
and Java already can do, better than those languages, IMHO.

But I'm coming around to the idea that to "win the election", D needs to look
like a solution to a crisis, or at least some phenomena that Bill Manager can
claim was a new problem that needed a new solution.  Little problems won't cut
it, even if your project is dying of thousands of little papercuts.

(As an illustration, I changed the title of this post - snappier, right?  The
following may seem a bit cynical, but I'm just trying to be practical.)

People who pick (or at least sign off on) programming languages will drag their
heels to adopt unless there is a motivation they can "feel".  Reduces pointer
errors by 35% and code length by 20% is not good enough, even if it would save
the software industry.  I once described D to a colleage as a language that
"improves hundreds of little things that taken together are revolutionary".  But
I couldn't think of a "killer app" story for D.

This is not a criticism of business, its just that to take a big risk, managers
need to know (1) what problem they are solving, (2) how to measure whether the
solution is working.  Otherwise they feel they could easily get conned by silver
bullet salesmen -- it's happened before, right?  If you ask a big-name CEO what
problem he is solving with a new initiative, its a "moment of truth" question
for him.  He won't argue incremental improvements, he'll strike at the core of
something he thinks is close to your heart and explain how his company can help.

Let me propose some general hype; these will look a little like hyperbole, but
most of them are more or less true (or could be without *too* much pain):

1. D unites scripting style and C/C++ performance.

2. D is like C++ after the lessons learned from Java, Python, and Perl.

3. D is a high performance Java.

4. D can do Perl or Python-style rapid development, but is safe enough and fast
enough for "BIG" problems.

5. D is like Java, but for systems programming tasks.

6. D has all the power of C++ with the safety of Java.

[ Noone knows exactly what the previous means, but it leverages Java's claims.
Since much of Java's safety claims were on the basis of pointer elimination, D
can legitimately claim much of the same benefit. ]

5. D is compile anywhere, run anywhere.

This is not true yet; would be immense to accomplish unless the D compiler was
distributed with GCC.  This is unfortunate, since the DMD compiler is so fast
and focused, but I think lack of platform portability is a killer for a compiler
(but not so much for an interpreter for some reason.)

I see two possible futures in which D is ubiquitous, i.e. as much as Java now.

FUTURE 1: The DMD compiler is used for fast development and to run D "scripts".
The high compile speed makes it perfect for scripting and rapid development on
the platforms it does support, and GCC's D compiler makes sure the rest of the
platforms don't have to go begging.  Everyone gets fast development and every
platform can build binaries.  But GCC would need to support D out of the box.

FUTURE 2: The D compiler occupies a niche like Perl or Python, Tcl, etc, where
there is one "blessed" compiler, but it still gets installed by everyone.  All
of these seem to be scripting languages (why is that??).  The only way this can
happen (I think) is if D supports every platform (very very much work, I
think...) or can at least produce and run some kind of bytecode.

[ D in bytecode sounds tricky, but I don't know enough to know how many genuine
obstacles there are.  I would think the "Java subset" of D could be done this
way, but... ]

Compiled languages generally don't seem to take off until there is a compiler
available for every big platform.  (Am I wrong about this?)

And to top it off, a "customer anecdote":

I work at a government job, writing public services and C++ libraries for
biotech apps.  I imagine walking into a meeting and saying that there is this
cool new language, D, "but it only works on 32 bit amd/intel".  This would be
enough to reject D (all our servers are 64 bit amd/intel already, and we also
provide Solaris, IRIX, OSX, and Windows binaries).

Which is too bad, because we are a high-performance project (we worry about
cache lines and register pressure all the time), that suffers from C language
pointer-related mishaps and C++ syntax related burn out.  In many ways, D is
perfect for the niche we are in.

But on the other hand, our project has spent the last 3-5 years shifting from C
to a rewritten-in-C++ version.  So it's probably a no-fly zone for new language
adoption in any case, for the next few years.

Kevin





More information about the Digitalmars-d mailing list