On Friday, 24 August 2018 at 04:12:42 UTC, Jonathan M Davis wrote:

Unless you're trying to argue for folks dropping Phobos, that's just not going to fly. Phobos uses libc heavily, and it really can't do what it needs to do without it (e.g. file operations). Divorcing druntime from libc may help folks focused on embedded development and who don't want to use Phobos, but for most D programs, it really doesn't provide any real benefit to try to make druntime not use libc. So, while such an effort may provide some benefits, I don't see how it could really be for anything other than a niche part of the community.

It's not a problem for Phobos to depend on the C standard library. My goals have to do with making D, the language, freestanding (a.k.a nimble-D).

If and when druntime no longer depends on the C standard library, the bindings can be moved to a separate repository (e.g. Deimos). A compatibility shim can also be created in a separate repository to forward `core.stdc` names to `c.std` or whatever name the new repository chooses. That compatibility shim could be marked deprecated in favor of the new name, and then many years down the line it can be removed (or kept, I don't care). It then becomes part of the toolchain packaging process to add Deimos-libc and the compatibility shim to the dmd.conf file and include it in the distribution. Users won't even know it happened. Users's coding in D, the language (no Phobos), will no longer have to obtain a C toolchain to generate their binaries.

We're at least half a decade away from any of this, and there's a good chance it will never even happen, so don't sweat it.

And about niche use case. They're niche right now because D doesn't provide good support for them, and noone's writing D software for them. If I have my druthers, that's going to change, and those use case will become major considerations when making language design choices, and it will become obvious that C is a more of a liability than an asset.

Mike

Reply via email to