virtual-by-default rant

James Miller james at aatch.net
Sun Mar 18 14:36:56 PDT 2012


On 19 March 2012 06:41, David Nadlinger <see at klickverbot.at> wrote:
> On Sunday, 18 March 2012 at 17:24:15 UTC, F i L wrote:
>>
>> […] I know LDC has a  LTO flag.
>
>
> Unfortunately it doesn't (-O4/-O5 are defunct), but working on seamless LTO
> integration (and better optimization pass scheduling in general) would be
> low-hanging fruit for anybody wanting to join LDC development.
>
> David

I think that simply adding a `virtual` keyword that explicitly makes
things virtual, even if they would otherwise be final, makes sense.
Keep all the current semantics the same, relegate use of `virtual` to
the 'advanced' section of D usage, everybody is happy.

I'm with Manu in the case of "I don't trust the compiler". I'm
perfectly happy for the compile to optimize short sections of code
that I probably could optimize myself, but its not much of an issue,
but I am reluctant to rely on the tooling to make decisions for me.
For small programs, where it doesn't matter if it's half as fast as it
could be, but that just means 2ms vs 1ms, I don't care. But in
intensive programs, then I want to be sure that the compiler will do
what I want.

--
James Miller


More information about the Digitalmars-d mailing list