Comments by "TheEVEInspiration" (@TheEVEInspiration) on "what is wrong with rust and linux????" video.
-
1
-
1
-
First
An OS must be language neutral and provide just a service to the outside and facilitate clear communication via APIs and services around process management/recovery.
Second
There must be clear boundaries between binaries, each possibly written in a different language.
The APIs connecting them should adhere to the most basic information exchanges and not carry over "object" responsibilities between binaries.
I get the feeling neither of these two rules has been followed or people are now trying to break these basic rules.
1. The rust bro's try to put semantics where they do not belong via their language.
2. The C bro's might already have convoluted APIs where the unenforceable responsibilities shift over binary boundaries, without going crazy on types.
So maybe both are wrong.
Developers just expect/need clarity who owns a piece of data and that the responsibility over that data to be with the binary that defines/instantiates that data.
This is why file systems work with simple integer handles and do not share the actual data structure behind it with the outside! Ideally, if a structure holding information needs to be communicated to the application, the integer handle should be used to produce a read-only copy of requested data and not an internal object. The API must form a clear isolation from the internals of other binaries. I will even argue that the application should provide the memory for the output from its own pool, as well as how much it allocated. This way the service behind the API can grow its structures if need be.
If there are any checks that a API client needs to do, like checking for NULL and/or some standard first element member check, it should apply to all API calls on not just specific ones!
If more complex rules than this apply around the given out data, this should by standardized by the facilitating OS Kernel.
In a way that allows the producing binary, say a file system binary, to do proper cleanup when an application crashes.
If current binaries and/or Linux kernel work different, then in my book, its a mess.
Can't have an application be responsible for the internal state of a file-system after all.
1