all OS functions should be "nothrow @trusted @nogc"

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 27 13:41:55 PDT 2017


On 07/25/2017 10:54 PM, Walter Bright wrote:
> On 7/25/2017 8:26 AM, Andrei Alexandrescu wrote:
>> A suite of safe wrappers on OS primitives might be useful.
> 
> The idea of fixing the operating system interface(s) has come up now and 
> then. I've tried to discourage that on the following grounds:
> 
> 
> * We are not in the operating system business.
> 
> * Operating system APIs grow like weeds. We'd set ourselves an 
> impossible task.
> 
> * It's a huge job simply to provide accurate declarations for the APIs.
> 
> * We'd have to write our own documentation for the operating system 
> APIs. It's hard enough writing such for Phobos.
> 
> * A lot are fundamentally unfixable, like free() and strlen().
> 
> * The API import files should be focused solely on direct access to the 
> APIs, not adding a translation layer. The user of them will expect this.
> 
> * We already have safe wrappers for the commonly used APIs. For read(), 
> there is std.stdio.

The standard library would not be in the position to provide such, but 
the project seems a good choice for a crowdsource and crowdmaintained 
library. -- Andrei




More information about the Digitalmars-d mailing list