Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Splitting libc into one "stable kernel API" part and one "library with things which are useful to C programmers" part would honestly make a ton of sense. OSes which declare their syscall interface to be unstable would be more convincing if they actually provided a stable API that's intended for other consumers than C.


Frankly I don't see the point of complaining that libc is not useful for non-C consumers. Sure, there are some ancillary functions in libc you'll likely never call. But what's the issue with making syscalls through libc? Again, the only difference is what the very last call instruction is. If your runtime can marshal arguments for the kernel, then it surely can marshal arguments for libc. They are almost always practically the same ABI.

And you can avoid the need for VDSO-like hacks which is basically the kernel exposing a mini-libc to userspace.


This is the reason why Rust compiles every program statically, except that the resulting “static” binary still has to link against libc.


Graphical programs also have to link against libGL which also means linnking against libc, same for many other system libraries that make no sense to reimplement in your NIH language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: