4 ms·
When I say "but file descriptors are good" I mean https://en.wikipedia.org/wiki/Object-capability_model https://en.wikipedia.org/wiki/Object-capability_model is
by Ericson2314 3y ago
When I say "but file descriptors are good" I mean https://en.wikipedia.org/wiki/Object-capability_model https://en.wikipedia.org/wiki/Object-capability_model is the goal.
I don't believe "object-oriented" has any concrete meaning, so I have a hard time interpreting what you mean by that. Window's HANDLE * is good though, and I recall in some cases NT made some things handle-based ahead of Linux / BSDs doing so. (e.g. is `NtCreateFile` older than `openat`? Maybe?)
Powershell is nicer than bash, but doesn't PowerShell run on linux? I would think the integration with a proper standard library and language runtime (C#'s, CLR) is more important than what the system calls look like.
No downvote from me :)
- steve1977 3y agoWhat I mean with “object-oriented” vs “file-oriented” is more the philosophical approach of the systems. I think the “everything is a file” approach of UNIX has its strengths but it also breaks down at some point. So with the example of PowerShell (on Windows), I like that I can actually pass around objects which I then can query for details if I want to, but which can also hide their details if they’re not needed. In contrast to files (or rather text), where details are always exposed. This is often seen as an advantage as it’s directly “human readable”, but in my experience it often makes for more complex command lines. As said, both philosophies have their pros and cons, I just don’t see the UNIX one as the one and only truth. But I generally try to be pragmatic and will happily use Windows or some UNIX derived system (or something else) depending on the use case.
- Ericson2314 3y agoI think Unix fails at "everything is a file" but that's actually good. When you say "pass around", what do you mean? Is this some userland struct future syscalls will inspect manipulate? Or are you passing HANDLE * references to an opaque resource? I very much agree text is bad. :)
- steve1977 3y agoI mean (for example) that in the shell I can pipe the output of one command to another, like on UNIX. But what gets passed is not text, but an object.
- BarbaryCoast 3y agoThe difference between Windows and Unix is the design of the OS. Unix famously handles "everything as a file". In Windows, everything is an "object" of some sort. This means that to be efficient in Unix, you need to be focused on files and text. But in Windows, you need to understand the OS objects, and how to work with them. Powershell excels at that. Someone ported Bash to Windows, but I'm still not sure why. It's a better shell than "CMD", but neither are well-matched to the Windows abstractions. I've never tried Powershell on Unix, but I suspect it'd suffer from the same "impedance mismatch" as Bash on Windows; it's just not designed to work on the right abstractions.
- steve1977 3y agoI’ve tried PowerShell on macOS, and yes, it feels a bit like Bash on Windows