[Proposal] Switch to the Universal CRT on Windows.
Adam Wilson
flyboynw at gmail.com
Fri Jul 3 05:14:30 UTC 2026
On Wednesday, 1 July 2026 at 12:37:22 UTC, Dennis wrote:
> In my own code I avoid libc as much as I can, using
> `CreateFileW` instead of `fopen` for example. Only a few
> essentials like memcpy and memset remain since LDC sometimes
> emits calls to that even when you don't write them yourself. At
> least those are simple and deterministic: I haven't found a
> libc yet that implements them visibly different than the rest.
There is a technical argument for leaving `libc` behind as well.
Specifically if you want to do anything with async operations
you're going to have to use the API's specific to that platform.
For example: Linux has `io_uring` where Windows has I/O
Completion Ports.
`libc` stops working as a universal system interface when you
need to do async work, which means that anywhere we might want to
support an async interface, we'll need to use something other
than `libc`.
Another example is terminal colors. Windows has
`SetConsoleTextAttribute()` where `libc` is the only choice on
Linux. Which means we really should be abstracting away `libc`.
IMO, BaseD is going to become that abstraction.
More information about the Digitalmars-d
mailing list