2 ms·
We rarely replace the foundations, we just paper over them. I don't think this actually matters, except when it breaks? I'm all for building a clean, simple sys
by lmm 3y ago
We rarely replace the foundations, we just paper over them. I don't think this actually matters, except when it breaks? I'm all for building a clean, simple system, but for me Unix would actually be the main part I would rip out (my preferred architecture would look something like unikernels on the server and a qubes-style cluster-of-communicating-unikernels on the desktop). If you're against adding complexity and memorizing trivia, Unix and C create more of those than the rest of the stack put together.
- Kamq 3y ago> qubes-style cluster-of-communicating-unikernels on the desktop Oh hey, yeah. A bunch of small utilities that communicate and interoperate. I can see it working out. You could even have them communicate with each other via some sort of universal interface.
- bb88 3y agoSo Java -> C is terrible but workable. C -> Java is terrible. Java <-> C++ is worse. C++ -> C is great. C -> C++ is terrible.
- lmm 3y ago> Oh hey, yeah. A bunch of small utilities that communicate and interoperate. I can see it working out. You could even have them communicate with each other via some sort of universal interface. The key is to have that interface be narrow and well defined - something like gRPC. Allowing them to communicate via a huge, poorly specified, non-concurrency-safe swathe of shared state (filesystems with all their ad-hoc semantics, shared memory, signals, pipes, KAME sockets, namespaces, goodness knows what else two processes on a Unix system can do to fuck with each other) is a recipe for disaster.
- Kamq 3y ago> The key is to have that interface be narrow and well defined - something like gRPC. You really can't use a mesh of unikernels for this then. You need an external system to enforce the types (like a compiler does for a single program). At runtime, so far as the computer cares, there's really just arrays of bytes (or machine words depending on if your system is really byte-addressable or just faking it). You can do input validation, but unix cli utilities can already do that. You'd need, rather than a bunch of unikernel utilities, an all encompassing environment that the utilities can register their constraints with, and the system would prevent them from being called if the constraints were not met. Main contender is probably emacs, just because it's already ahead on the "all encompassing environment" part of this.
- lmm 3y ago> At runtime, so far as the computer cares, there's really just arrays of bytes (or machine words depending on if your system is really byte-addressable or just faking it). The problem isn't arrays of bytes. The problem is all the other semi-structured cruft that the OS has accumulated, the squillion different system calls you can make with almost-but-not-quite standardised effects. > You can do input validation, but unix cli utilities can already do that. You'd need, rather than a bunch of unikernel utilities, an all encompassing environment that the utilities can register their constraints with, and the system would prevent them from being called if the constraints were not met. Or you just don't give them the interfaces to mess with each other's internals. You have your hypervisor isolate them from each other except for a narrow communications channel obtainable in a narrowly specified way. Ideally the hypervisor also enforces that what you send/receive is well-formed gRPC (which is not hard), but that's not essential - the main benefit comes from just closing off all the other random OS-level ways that Unix processes communicate with each other.
- bb88 3y agoUnfortunately, still in 2023, one's OS is still largely dependent upon C (and assembly for certain optimizations). Rust is dipping it's toe into the OS world yet, but isn't fully mainstream. Also a lot of that C code in Unix, you know, actually like works and has worked for a long time! 50 year old C code in a Unix operating system isn't going to be unheard of here shortly.
- lmm 3y ago> Unfortunately, still in 2023, one's OS is still largely dependent upon C (and assembly for certain optimizations). We mostly don't actually use the OS though. We write code that gets deployed on some managed cloud system, and to the extent that there's anything in between (a unix process, kernel and virtual machine to run the code) we probably cargo cult it and don't worry about the details unless it breaks. Building unikernels (which is increasingly practical, with OCaml leading the way but other options available) would sidestep many of those layers of junk. ("Serverless" is another way to achieve the same thing, and may well be the one to succeed; even if serverless systems don't currently use unikernels, they could be transparently upgraded to them in the future, if they're strict enough about the interfaces they offer at the moment).