OpenBSD port of dmd?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Mar 16 17:16:41 PDT 2012


On 3/16/12 6:30 PM, Walter Bright wrote:
> On 3/16/2012 4:18 PM, Walter Bright wrote:
>> On 3/16/2012 4:04 PM, Andrei Alexandrescu wrote:
>>> Never say never. There are I/O routines that are specialized for
>>> several OSs and
>>> fall back to a generic (slower) implementation.
>>
>> I'm going to suggest that is wrong as well. It's fine for a new port
>> to use a
>> generic slow implementation, but that ought to be a deliberate choice,
>> *not* a
>> default that went unnoticed during the porting process.
>>
>
> I should explain this better. Having a default is wrong because:
>
> 1. as mentioned, it can be overlooked in the porting process
>
> 2. if the default doesn't work right for some system, the temptation
> will be to 'fix' the default in ways that are untested (and therefore
> broken) on other systems. Working on one system's code should not affect
> other systems!
>
> 3. it leaves unknown to the reader what systems that may apply to
>
> I know the powerful temptation to avoid copypasta. But I have decades of
> trying it that way, and it just leads to lots of time wasted tracking
> down bugs. This includes historical bugs from doing it that way with
> druntime & phobos.

Not convinced. They call it specialization, and it's a powerful concept. 
We use it in std.algorithm all over the place.

Andrei


More information about the Digitalmars-d mailing list