4 ms·
>Instead of "everything is a file", "everything implements well-documented object-oriented interfaces" would be much better idea. Why "object-oriented" specifi
by TwentyPosts 3y ago
>Instead of "everything is a file", "everything implements well-documented object-oriented interfaces" would be much better idea.
Why "object-oriented" specifically? Is this in any sense different from non object-oriented interfaces, eg. Rust's traits or Go's interfaces, or just to make it more clear that you're talking about interfaces in the programming languange sense?
- samus 3y agoThe operation system already very much behaves like an object-oriented system, even in a languages without language support for this: you ask the OS for a handle, which has to be passed as the first argument to any system call. The kernel has figure out what object the handle refers to and redirect the call to the appropriate subsystem. This is abstraction and polymorphism. And of course, the kernel won't give you any access to internals by default, which gives you encapsulation. The argument of GP is that file-oriented interfaces like `rewind` or `seek` are ill-suited for anything that doesn't behave like a seekable file. `read` and `write` work well for anything with a streaming interface, but are utterly unsuitable for things like processes. You'd have to layer protocols on top of it.
- lproven 3y agoNot really, because then, the influence reaches deep into the programming language, and that means you get one of the many single-language type OSes, like Smalltalk, or Oberon, or Lisp Machines. They do have many advantages, but lots of people don't like being compelled to use just one thing, and I think that's a huge factor in how the Unix/WinNT model did so well.
- Spivak 3y agoLook into COM/dbus. There are generic language independent object models.
- lproven 3y agoI am aware of them! Do you really think that something like this is suitable to be embedded as the core internal communications mechanism of an entire operating system? 'Cause I don't. Do you remember, for example, that the original plan for the GNOME desktop environment was that components would communicate over CORBA? They abandoned that after version 1.
- Spivak 3y agoOh I absolutely think so, in fact I really hope kdbus gets merged and eventually it gets used to expose kernel structures Processes being real objects /kernel/proc/1363 with interfaces like org.kernel.proc.Process1 that allow you to manipulate them with generic message passing/function calls would be amazing.
- lproven 3y agoHuh. Okay then. Me, I'd prefer to throw the whole lot out and start over with something clean that incorporated this into its central design.