Yes, but even that convention is tied to the structure of the languages that are supposed to be used with said OS. What you describe is syncronous was if calling the OS kernel. But asynchronous one can also exists. And there are more exotic ways, too (I gave the links).
But most importantly: most OSes describe it's ABI in terms of C ABI.
Not just the OS, but also an instruction set. Why do you think things like PCMPISTRI
were added to SSE4.2? Why do you think modern CPUs have stack (except for Z/Architecture?).
It's a bit of two-way street, of course: C was designed to match PDP-11 and then modern OS and hardware was made to match C⌠OS can be easily changed, but some decisions would stay even with ânative RUst OSâ, because they are embedded in the hardware, at that stage.
Rust would help with security, indeed, but as long as API is expressed in terms of extern C
it wouldn't make OS fundamentally different.
The question whether is should is a good one⌠and one I have no answer for.
This is strange request. It makes as much sense as request to write OS in C without a single asm
block.
Rust have unsafe
for a reason, in fact it's precisely because Rust have unsafe
we may even talk about writing OS in Rust.
Most other âsafeâ languages couldn't run on bare metal. Rust can.
libc is not âin-betweenâ. It's part of OS. And it's specifically that part that provides stable ABI on most OSes. Linux is rare exception and is only acts like that for a historical reason.
Take Windows e.g.: do syscalls exist there? Yes. Can you use them? No. They change numbering and list of arguments regularly and applications couldn't use them, for this reason. They are calling NTDLL.DLL and it's ABI is very much specified in terms of C ABI.
And dynamic loader is part of OS kernel and couldn't be changed (we had separate thread about that).
On the majority of OSes it's an implementation detail.
Yes. Linux is a weirdo. Very popular, but weirdo. And even Linux is shaped, to a large degree, by the C ABI.
It can, but as long as Rust doesn't have any other ABI to âinterface withâ it's pointless to ask how Rust may change OS space.
For all practical purposes, from the app development POV Rust is âextremely fancy version of Câ for it have no way to express anything by C API to them.