Ready for review: new std.uni

David Nadlinger see at klickverbot.at
Sun Jan 13 15:10:15 PST 2013


On Saturday, 12 January 2013 at 05:44:00 UTC, Walter Bright wrote:
> No problem. I think it's great that you're the champion for LDC.
> Having 3 robust compilers for D is only a win, and I don't 
> think having 3 takes away from D at all.

I precisely did *not* want to drag LDC into this discussion, but 
I guess it was unavoidable given that I talked about it in the 
first part of my post, and of course because I'm the one 
maintaining it right now.

So, just to clarify, I took up LDC development mainly because it 
produces significantly faster code for some of my projects, and 
it would have been a shame to let it die from a marketing point 
of view. If I had lots of spare time (which I don't have right 
now) I'd certainly try to help out with a D-based compiler 
project instead. So it's not like I'm overly attached to LDC, 
emotionally – resurrecting it just seemed like the most viable 
short-term solution.

But yes, you are right, having 3 robust compilers for D would 
certainly be a good thing for D. But unfortunately, I think it 
would be quite a stretch to say that we have even a single such 
one right now.

To elaborate – and again, please don't take this as a personal 
attack –, every time this discussion comes up you seem to resort 
to the »diversity is good« cliché without ever actually 
responding to the arguments other people bring up. You want to 
stick to the DMC backend? Fine, that's your good right, but 
wouldn't it only be fair to share your reasons with the other 
people who are investing considerable amounts of work and time in 
»your« language?

As a note aside, I think this point is much deeper than it might 
appear at first. Sociology is not exactly my field, so I don't 
know what current research has to say about this, but at least to 
me it seems obvious that a healthy culture of communication is 
essential for the success of any non-trivial open source project. 
Even if it would be short-sighted to claim that all disputes can 
be resolved by a good technical discussion, it seems to go a long 
way towards reaching a consensus in most cases; and many 
engineers/scientists/hackers seem to regard it as the norm. On 
the other hand, it seems like failure to communicate the reasons 
behind a given decision is one of the most effective ways to 
cause (potential) contributors to turn away, looking for a more 
promising project to throw their spare time at. And to be honest, 
I think some of the most unfortunate events in the history of D 
can be directly traced back to such communication failures (I 
hope it is obvious what I'm alluding to here?).

But let's return to the particular topic I brought up. To recap, 
my impression is that several large players in the industry have 
started to pool their efforts regarding compiler development, as 
spending the ever-increasing amount of work needed to come up 
with their own state-of-the-art optimizer is no longer justified 
by the potential advantages this would offer over their 
competitors – maybe quite similar to the almost universal success 
of Linux in the OS domain.

So, in short, even if the DMC backend was technically superior to 
every other solution out there right now, I would be hard-pressed 
to make an argument for preferring it over a more widely used 
solution like LLVM because of this. I cannot see how putting work 
into a custom backend could realistically help to make D more 
attractive compared to other languages, so the current situation 
seems like a case of making things unnecessarily hard for 
ourselves.

Of course, as with any open source project, it would be foolish 
to try and tell you what to spend your time on. But I would 
really be interested in your long-term vision for D(MD), because 
as noted before I can't see any signs that the expectations at a 
compiler backend will drop in the future (more and more vector 
units in processors, the rise of ARM, ...), and even when 
neglecting the platform support issue, I'm not sure how good an 
offer D would still be if its main implementation started to 
perform significantly worse than common C++ compilers.

To summarize: Although there is quite a lot of promising 
development going on in the language space right now, I still 
think D has an excellent offer to make, otherwise I would left 
the camp long ago. But it doesn't seem wise to intentionally 
weaken our position in the arena by spending considerable amounts 
of manpower on solving a problem from the ground up for which 
there is already a free off-the-shelf solution that would get us 
at least 95% there – and the fact that our resources are limited 
is precisely what you seem to neglect when reciting the 
»diversity is good« mantra.


> For example, LDC doesn't work with VS, and so would have cost
> us the possible design win at Remedy.

In view of the above, I'm not sure how much weight this argument 
could carry, but I don't think it is valid in the first place: If 
our reference compiler was backed by LLVM, you could have just 
added CV8 support to it like you did for DMD. By the way, the 
other thing missing from LLVM regarding VS compatibility is SEH 
support, but DMD doesn't implement that either (LLVM actually 
supports EH on MinGW right now, so the implementation could 
likely have been re-used as a workaround, just like you did for 
DMD).


David


More information about the Digitalmars-d mailing list