3 ms·
It's not so unusual to write the C stdlib in a different language. E.g. Zig is getting a libc written in Zig: https://github.com/ziglang/zig/issues/514 https:
by flohofwoe 3y ago
It's not so unusual to write the C stdlib in a different language.
E.g. Zig is getting a libc written in Zig:
https://github.com/ziglang/zig/issues/514 https://github.com/ziglang/zig/issues/514
Rust would work too of course. MUSL is probably the only popular C stdlib actually written in C.
- 2OEH8eoCRo0 3y agoI think their point is that the c in glibc stands for C, as in the language. A glibc rewrite in Rust wouldn't be glibc anymore!
- wongarsu 3y agoWell, the Common Language Runtime that powers .Net languages isn't written with .Net, and the Java runtime environment isn't written in Java. I know these are a lot more involved than the functions provided by the glibc, but the point is that libc means Library for C, not Library in C. And of course on Unixes all software is expected to link to the glibc for basic functionality, no matter whether it's written in C or not. So the name is only historically accurate.
- wrs 3y agoYes, but even more so. Linux “expects” programs to link to libc, but many other Unix-like OSes require programs - in any language — to link to libc. The kernel syscall interface is not considered a stable API. Windows has a similar structure, but the required kernel interface library is not the same one as the C runtime, so it’s less confusing language-wise.
- pjmlp 3y ago> Well, the Common Language Runtime that powers .Net languages isn't written with .Net, and the Java runtime environment isn't written in Java. Actually a large part of it is, and in Java's case there are bootstraped implementations, OpenJDK isn't the only one. Java is like C and C++, where multiple implementations are available for a given specification. https://docs.oracle.com/javase/specs/ https://docs.oracle.com/javase/specs/