D benchmark code review

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Dec 14 19:08:15 PST 2013


On 12/14/13 11:46 AM, "Ola Fosheim Grøstad" 
<ola.fosheim.grostad+dlang at gmail.com>" wrote:
> On Saturday, 14 December 2013 at 18:46:50 UTC, Joseph Rushton Wakeling
> wrote:
>> Very curious about what you mean here -- I think most of us find that
>> D's template syntax is much superior to C++, so I'd really like to
>> understand what you find problematic.
>
> I dislike the syntax. :-)

It should be mentioned that years ago I proposed using '.' instead of 
'!' for templates. Walter actually gave me a patched compiler that I 
used for a few weeks.

The code didn't look much better, but one important simplification did 
result from that push: we eliminated parens wherever only one argument 
was involved. That turned out to be a good thing.

> And well, as far as I can tell I also dislike
> the semantics, but it is no worse than C++. I would like to see a modern
> language with templates to do it well. That is to be more in the
> direction of readable term-rewriting, pattern-matching with constraints
> that will make it possible to do clean operator-overloading etc.  More
> in the direction of legible Pure, Haskell etc.

This is vague, and as many cool while vague things, may turn out to be 
less attractive when the details are worked out. In particular "clean 
operator-overloading" has been discussed in this group as a distinct 
non-goal and potential anti-pattern if taken too far.

>> I don't think things are actually as spread out as you think. In
>> reality, there is one compiler frontend that everyone collaborates on.
>
> You could be right, I am only talking about the impression I am getting.

Well he is factually right. And facts are prone to changing impressions.

> "The smoke-signals being received from a distance". When you don't have
> one excellent compiler, but three in-the-works, it sends signals of a
> lack of direction and implies a lack of a leader that can rally everyone
> into something cohesive. This is not a critique of anyone, most
> programmers want to be creative and argumentative, not to "nurture",
> "manipulate" and "wave the whip" ( I am not even sure I like people who
> are "great leaders" ;^).

One lone compiler that everybody hangs on for dear life would be a 
distinctly bad place to be. A mishmash of a dozen alpha-state compilers 
would be just as bad. Three compilers that share the core language and 
complement it with distinct backends is quite the sweet spot to be in. I 
had no idea one could frame it as a bad thing.

>> I think it might be worth giving things another spin.  If the last
>> time you tried using D was a couple of years ago, you will find that
>> things have changed a great deal in terms of performance, features and
>> general quality.
>
> Let me rephrase what I am perceiving like this: for me D is currently a
> solution without a problem.

[snip]

> Do you think I am unfair?

Fairness has little to do with it. By and large I'd say, if you don't 
have a problem for which D is the best or at least a advantageous 
solution, it's entirely reasonable to not reach for it.


Andrei



More information about the Digitalmars-d mailing list