
The Case for D - signa11
http://www.ddj.com/article/printableArticle.jhtml;jsessionid=B3NCDIGAOTCJ1QE1GHPSKH4ATMY32JVN?articleID=217801225&dept_url=/hpc-high-performance-computing/
======
Keyframe
D1 + Tango == yes! Excellent combo, but serious lack in the toolchain
department. DMD and OPTLINK especially is a failboat currently. LDC is based
on LLVM and is "the future", but lacks windows support (exceptions! and this
is inherently LLVM's problem now). DDBG is a good debugger, but is
unmaintained. GDC is D on GCC, but is unmaintained.

D2 on the other hand doesn't feel like D anymore at all. Sure, there are a
couple of nice things in it like ranges, but on the general perspective I
could make this comparison: D1 is like C with C++ made right. D2 is D++, what
C++ is to C - bloat and inconsistency.

There is also a huuuge problem with D2 and leadership/drama, which split the
community. There is also problem with Phobos vs Tango - where Tango is clearly
and measurably better, but that thread of issues leads to leadership drama.

Let me be clear on this (I use D every day for my projects - I am into
graphics/gamedev with it). Do yourself a favor and learn D1/Tango - toolchain
is bearable and there is a book about it from Apress. Community is responsive
(#d, #d.tango on freenode if you demand prompt resolutions). Use Tango from
SVN, use LDC or DMD if you are on Windows.

Also, check out <http://www.team0xf.com:1024> \- especially dog (OpenGL
platform agnostic binding) and hybrid (gui on top of it). Check out
<http://www.dsource.org> .

There are some movements within the community that will resolve by themselves
soon enough - it's too good to fall apart. In the mean time you should really
do yourself a favor and give it a go.

------
steveklabnik
There are two big problems with D.

1) Everyone treats D2 as being the current stable version of the language,
when it isn't. 2) Tango vs Phobos when it comes to D1.

But trust me, the D community is aware of those things. [1] There are a lot of
tensions over the developments of D2, how they're going, etc. If and when D2
ever actually comes out, it should address lots of the issues.

But you may see something sooner than that.

[1] : <http://www.jfbillingsley.com/blog/?p=53>

~~~
Nelson69
A top quality, supported, opensource compiler would help. The LLVM front-end
looks promising but I half expect it to be abandoned. It's kind of odd, it
definitely seems like there is a desire for a compiled machine code producing
language to compete with C and C++.

I kind of remember this argument with Ada over the years, particularly when
the GNAT front-end to GCC was mainlined. Having tools available is a big
noticeable percentage of the problem; maybe 30-45%. Tooling is becoming more
than just a compiler though, an eclipse IDE for D would be nice too and it's
probably required for serious consideration by the masses. Supported and live
are important for this stuff.

Another aspect of adoption seems to be adoption. It's a snowballing kind of
thing. In the GNAT/Ada days there were a lot more advocates of its use than
there were users. If you really want D to start getting more attention, then
start doing some successful D software, particularly packages that get
attention seem to be good (see Mono and Tomboy) Ada has a good complaint
compiler that is supported and still doesn't have many users. Some free/open
software that shows some of the benefits and advantages of D would help.

~~~
steveklabnik
Yes. This is actually is one of the main points of contention... that the dmd
frontend is 'source available.' The community is doing some things to address
this, but that's all I'll say.

LDC is a really great project. It's not being abandoned anytime soon, trust
me. Those guys are working hard, and they answer bug reports really, really
fast. Though I'm admittedly slightly biased, since they use my kernel as a
test case.

There are several IDEs that support D, though I can't think of them off of the
top of my head, since I use vim. Posiedon?

There have been several intersting D projects, but you're right, more would
certainly help. The blog post I linked to's author wrote a little language
called MiniD that's pretty interesting, I (and several others) are writing a
kernel, etc... but dsource.org can look like a graveyard sometimes...

~~~
WalterBright
The dmd front end is GPL'd.

~~~
steveklabnik
Thanks for the correction, Walter. As Wikipedia says:

The Digital Mars D compiler is the official D compiler by Walter Bright. The
compiler front-end is licensed under both the Artistic License and the GNU
GPL; the source code for the front-end is distributed along with the compiler
binaries. The compiler back-end source code is available but not under an open
source license.

------
stevejohnson
D is well-designed and has many wonderful features, but its documentation is
so bad as to make it unusable for serious work. This article is the _best
reference work_ on D2 that I have yet seen, which should not be the case.

Also, this guy has been working on the book for over two years now. Even when
it's done, it's going to be just like Grails is now: you can read the online
docs, but you don't really get it until you read a certain book.

~~~
martincmartin
> you can read the online docs, but you don't really get it until you read a
> certain book.

Isn't that expected and normal for anything that involves thinking about
things a different way? D has language features that most programmers aren't
familiar with, so to use the effectively involves a shift of thinking. Same
with Grails.

~~~
stevejohnson
It's not that books are bad, it's that there is _only one book._ If it's not
in The Book, you essentially can't find it anywhere, unless your mailing list
spelunking skills are particularly good.

~~~
FeepingCreature
I never read The Book, instead learning the language entirely by the spec.
It's honestly not that hard.

------
shin_lao
The question is, is D better enough than C++ to make us switch?

When taking over you must not just be better, you must be a hell better to
justify the cost of the switch.

~~~
Keyframe
D might not be better from the glance over it, but it's little things in it
that REALLY add up. I strongly recommend anyone who ever wrote C++ code to
give it a go for at least a couple of months and see for themselves. That is
the best way to measure - I can only give you my sincere recommendation to try
it out.

~~~
shin_lao
It looks great, I agree. I like the range approach for the standard library. I
also like the end of the include nightmare.

Is the output binary as good as a C++ one? That would be my first purely
technical concern.

Other concerns would be related to the building tool chain and the quality of
IDEs.

But the real concern is business oriented.

For pet projects I'd be inclined to give a green light. It's always nice to
play with new technologies as it opens your mind and give you new ideas.

For full fledged commercial products you expect to live several years, that's
going to be a solid red light. I wouldn't take the risk of using an
unsupported language.

~~~
Keyframe
"I like the range approach for the standard library"

This is D2 - I don't use D2 and wouldn't use it. I was talking about D1/Tango
combination. I don't think I'll make a switch to D2.

"Is the output binary as good as a C++ one? That would be my first purely
technical concern."

That depends on the compiler/linker, of course. In short - dmd good enough,
ldc great (llvm as the backend after all).

"Other concerns would be related to the building tool chain and the quality of
IDEs."

You can download DMD/Tango package from their Trac page and you're ready to
go, however I would strongly advise you to use SVN tango version - which
implies you need MSYS(on Windows) to build it. Ask for help on forum there
(dsource.org/projects/tango) or on irc d.tango (freenode). As for IDE, you can
use Descent for Eclipse, as some people do. I use Emacs for everything though,
same applies for D - there is a module for it.

"But the real concern is business oriented."

There is no concern here, since basics of risk management should tell you not
to use it. Same applies for other emerging or obscure technologies as well
(I'm looking at you Lisp). Short answer, don't use it for business critical
things yet, though some have done that with success.

~~~
shin_lao
I'm curious, why don't you want to do the switch to D2? Is it because it's not
mature enough?

~~~
Keyframe
There are several reasons. I'll try to list them, but it might not be
complete:

\- D2 looks and feels foreign to me as a somewhat D1 experienced user

\- Templates maelstrom and strong emphasis on them

\- D1 grew organically, D2 looks like an academic exercise where stuff is put
in just for the sake of it by the people that don't write programs in D at all
(Andrei)

\- D2 book and Andrei are a filibuster for D2

\- Walter Bright listens to Andrei (ok, a smart guy) but he doesn't write D
programs, I doubt even Walter writes them (seriously). If you look at his
code, it is more of a C in D than D code.

\- I have little to no trust in DMD/OPTLINK, LDC/LLVM is what I'm after and
that front is D1 only, and looks like it will be

\- Lots of people smarter than I am are on D1 also (Tango, namely) - and I
don't want to go against the trend since it would isolate me from little
support I can get

these are just of top of my head, there are more. General summation could lead
to "It just doesn't feel right" - at least for me as a heavy D1 user.

~~~
eldar
>> ...the people that don't write programs in D at all (Andrei)

>> Walter Bright listens to Andrei (ok, a smart guy) but he doesn't write D
programs

You stated twice that he doesn't write D programs. Well since you are
mentioning Tango, it's unfair because he writes code for a _standard_library_.
And he is writing a good code.

~~~
baxissimo
I also don't think it's true. In addition to writing code for the std.* Phobos
library, I think Andrei has been using D for data processing stuff related to
his recently finished dissertation. He would make comments from time to time
about this or that not performing well enough in std.*, and then go fix it.

------
aidenn0
Okay, I'm totally going to bite on the "find something you don't like in 30
seconds" and it's the hello world example.

void main() { writeln("about to do something important");
doSomethingImportant(); }

is this really not going to run doSomethingImportant() if the writeln fails? I
find that to be a poor default for a systems language.

This may just be a personal preference, but I strongly want a _systems_
language to do one of 2 things:

1) Require me to explicitly state when I care about an operation failing 2) At
compile time ensure that my code explicitly states when it's not going to
handle an exception. (Java with this, like so many things, gets it 90% right
and then falls on its face)

Silently passing exceptions out to the system is a bad default for something
that is supposed to be able to be used to build the system!

Note that this preference does not apply for a large swath of applications
programming. For a webapp, it may be reasonable to log any uncaught error
conditions to a log file, since we can just signal the client to try again.

~~~
WalterBright
Uncaught exceptions are caught by the D runtime code, and the appropriate
message is printed.

You can declare functions as "nothrow", in which case the compiler will
complain about any uncaught exceptions in the function body.

------
pornel
I've tried several times to write a project in it, and every time I found some
horrible bug, something missing, broken (OSX support is poor) or libraries
turned out to be useless/outdated (dsource is a graveyard), or that I've
chosen the wrong set (D1 vs D2, Phobos vs Tango).

I'd really like to use D, it's the non-sucky C++ I've been waiting for, but
it's just far from being usable and reliable yet.

------
req2
Kenta Cho, sole member of ABA Games, uses D to write his (excellent, open
source, freeware) shmups. Go for the code, stay for the games:

<http://www.asahi-net.or.jp/~cs8k-cyu/index_e.html>

~~~
tree_of_item
It doesn't seem like he uses D anymore. His last two games were written with
C# and XNA.

------
eru
`[...] the classic "hello, world" for other languages such as Java (code
omitted due to space limitations [...]'

