Why don't we use the CRT functions under Windows?

IGotD- nise at nise.com
Sun May 23 00:44:19 UTC 2021


On Sunday, 23 May 2021 at 00:13:51 UTC, Steven Schveighoffer 
wrote:
>
> But this is my opinion for our standard library. For DMD 
> though? I don't really care if it uses/depends on CRT. Ideally, 
> it should have an abstraction layer for these things, and use 
> whatever works.
>

Support for the C standard library and specific OS support isn't 
mutually exclusive. D runtime/phobos can also support CRT as an 
OS option with limited functionality. This would be equivalent to 
OS "any" in Nim, that supports whatever is provided by the CRT.

For Linux and Windows I would just go for the raw system API. The 
C library also imposes limitations and extra overhead. For 
example maximum allowed open files. The file operations also 
might do buffering in the CRT and the question if we want 
buffering there as well.


More information about the Digitalmars-d mailing list