On Friday, August 24, 2018 2:46:06 AM MDT Dave Jones via Digitalmars-d wrote: > On Friday, 24 August 2018 at 04:50:34 UTC, Mike Franklin wrote: > > On Friday, 24 August 2018 at 04:12:42 UTC, Jonathan M Davis > > wrote: > > > > > > 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 the poster feature for D in the upcoming years is memory > safety then how can Walter seriously consider continued > dependency on libc?
For any kind of normal operating system, you _have_ to use libc. It's part of the OS. Some pieces could be done without it, but on the whole, you use libc if you want to talk to the OS. That's just life. The only exceptions I'm aware of to that are embedded devices, and my understanding is that if anything, such devices are more and more likely to run a fullblown OS, making it that much less likely that you'd ever do anything without libc. Sure, we don't need to call C functions like strcmp, but if you want to do things like I/O, you have to use the OS' API, and that's libc. And yes, that means that we depend on code that's not vetted via @safe, but at this point, the major OSes are written in C, and they present a C API. So, accessing that functionality means depending on the OS devs to have gotten it right, much as it would be nice if it were verified with something like @safe. The same is going to happen with plenty of existing libraries that are almost certainly not going to have replacements in D (e.g. postgres, ffmpeg, etc). We're never going to completely escape the @safety issues introduced by C. Ultimately, the best that we can do is make sure that the actual D code is @safe as long as any libraries it uses are @safe. - Jonathan M Davis