System programming in D (Was: The God Language)

Manu turkeyman at gmail.com
Thu Jan 5 10:02:38 PST 2012


On 5 January 2012 19:35, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org>wrote:

> On 1/5/12 10:49 AM, Manu wrote:
>
>> I make this argument in support of the language expressing optimal
>> constructs with ease and by default, rather than expressing some concept
>> that feels nice to programmers, but puts a burden on the
>> whole-program-optimiser to fix.
>> For example, virtual-by-default RELIES on whole-program-optimisation to
>> fix, whereas final by default has no performance implications, and will
>> produce the best code automatically.
>>
>
> Your point is well meaning. I trust you understood and internalized your
> options outside a language change: using final or private in interfaces and
> classes, using struct instead of class, switching design to static
> polymorphism etc. Our assessment is that these work very well, promote good
> class hierarchy design, require reasonably little work from the programmer,
> and do not need advanced compiler optimizations.
>
> The D programming language is stabilizing. Making a change of such a
> magnitude is not negotiable, and moreover we believe the current design is
> very good in that regard so we are twice as motivated to keep it.
>
> At this point you need to evaluate whether you can live with this
> annoyance or forgo use of the language.
>

I do realise all the implementation details you suggest. My core point is
that this is dangerous. A new and/or junior programmer is not likely to
know all that.. they will most probably type 'class', and then start typing
methods. Why would they do anything else? Every other language I can think
of trains them to do that.
The D catch phrase 'the right thing is the easiest thing to do' doesn't
seem to hold up here... although that does depend on your point of view on
'right', for which I've made my argument numerous times, I'll desist from
here on ;)

I also realise this issue is non-negotiable. I said that in a previous
email, and I'm prepared to live with it (although I wonder if a compiler
option would be possible?)... As said, I still felt it was important to
raise this one for conversations sake, and to make sure this point of view
towards issues like this are more seriously considered in future.

That said, this is just one of numerous issues myself and the OP raised. I
don't know why this one became the most popular for discussion... my
suspicion is that is because this is the easiest of my complaints to
dismiss and shut down ;)
This is also the least interesting to me personally of the issues I and the
OP raised (knowing it can't be changed)... I'd rather be discussing the
others ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120105/b48ea213/attachment.html>


More information about the Digitalmars-d mailing list