114 points · by shawndumas · 12y ago · 65 comments
[0] http://www.amazon.com/The-Design-UNIX-Operating-System/dp/01...
"In the United States, the number of women represented in undergraduate computer science education and the white-collar information technology workforce peaked in the mid-1980s, and has declined ever since"
http://en.wikipedia.org/wiki/Lorinda_Cherry
Here's an interview with her that I just dug up:
I learned pretty much everything I needed from those manuals.
https://www.youtube.com/watch?v=ZLwd32muHwM
[1] Had about 12 Wyse 30 terminals hooked up to it as well as a Courier 2400 model to be able to dial into it.
That said right now I'm staring at 3 Thunderbolt displays hooked up to a Mac Pro with over 25 terminal windows going. All in different colors. (Well actually not different colors for all of them).
But using even the simple green screen was really cool. Definitely got a buzz using that system.
I remember the first test to show that it was "multi user". I put two of the terminals next to each other, hit return at the same time, and ran two things at concurrently. (Might have been ls -Rlt / or something like that.)
Ha, I used to do that sometimes, to make long-running disk I/O happen so that I could check something or the other that needed the I/O happening. Redirecting a process's output to /dev/null and putting it in the background with & can also be useful for many things.
I know people are going to roll their eyes at this, but Powershell's IPC constructs are a step forward. Everything inherits from Object which has the following prototype:
public class Object
{
public Object();
public string ToString();
public bool Equals(object obj);
public static bool Equals(object objA, object objB);
public static bool ReferenceEquals(object objA, object objB);
public int GetHashCode();
public extern Type GetType();
}
So if you want to just do strings you still can (string will inherit from type object, and must implement toString()).However if you want to do a List<Object> you still can, and better still the receiving process can use GetType() which has to be implemented, and then have a few different workflows to handle the type (e.g. List, string, et al).
UNIX was created in 1969(!) so nobody can blame them for designing it the way they did. However if you were creating UNIX today you'd definitely want to look at OOP and inheritance as a core pillar.
See this post for this topic: http://technet.microsoft.com/en-us/magazine/2007.07.powershe...
It would be an interesting to see if any such projects exist, because it would fit very easily into the current pipe IPC infrastructure, with the addition of transformative pipelines for interfacing with the existing string-base utilities, but that's necessary anyway.
I mean to say that there's no need to modify existing IPC mechanisms, just a need to establish a common serialization standard and embed it into a shell.
>I mean to say that there's no need to modify existing ICP mechanisms, just a need to establish a common serialization standard
PS gives you two things though. It doesn't just give you objects, it also gives you the behaviors of those objects as implemented by the runtime (CLR) that is common between both endpoints of the communication.
For example, consider a command that returns a list of processes running on the current session as a List of Process objects. This list is then piped to a command that filters the list to a sublist of processes that have a particular Name property. Finally, this sublist is passed to a third command that calls the Process.Kill() method on each of those objects.
This requires that all three commands not only agree on the structure of a Process object (as protobuf would provide) but also that it has a Kill() method, etc. This is possible in PS because all three commands are running in the same common runtime, but not possible with generic IPC.
IPC of complex objects has existed on Windows even before the CLR with COM and DCOM, and again both of these are more than serialization mechanisms, since they must support cross-process data as well as behavior.
If we are accepting that sort of languae lock-in, I'd rather get something like scsh off the ground.
There's nothing inherently linking the CRL to using objects within pipes. You could use for example JSON if you really wanted.
You can complain that the increase in ABI complexity isn't worth the extra features, but I don't think it is fair to complain about increased ABI complexity, period.
Edit: Of course, you have the option of writing a minimal wrapper in PS that shells out to your other-language command but the interface between PS and non-PS programs is still based on a string commandline.
I doubt it. Imposing structure and types on IPC would make it very difficult to compose separate programs.
Suppose I created UNIX-2, where the only difference between UNIX and UNIX-2 in principle is the fact that UNIX-2 programs all pipe serialized Objects to and from each other, instead of byte streams.
Now, the ls program obviously outputs more information than just a list of strings--it also outputs types of files, permissions, owners, inode numbers, sizes, timestamps, etc. I might be inclined to have ls output an lsOutputObject (derived from Object) that encapsulated all this information.
Suppose I wanted to pipe the output of ls into wc. How does wc handle an lsOutputObject? Either wc is programmed to know how to handle lsOutputObject, or it is not. Since we want an object-oriented environment, we'll assume the former case, so wc can call the appropriate object-specific methods and access the appropriate object-specific fields. But, now wc is tightly coupled to ls.
This problem generalizes. For a given program P in a set of N programs, wc will need to know how to access P's output-object-specific fields and methods. So, wc needs O(N) different subroutines to interact with the N other programs. This does not scale--each additional program I add to UNIX-2 will require me to write O(N) additional IPC handlers--one for each program.
The only way to avoid this IPC-handler-explosion in the design is to define the set of IPC objects a priori and mandate all programs know how to handle them. Then, there are O(1) IPC handlers per program, and adding a new program does not require me to couple its implementation to any other programs. This is effectively what UNIX does: there is one IPC object--a string of bytes. In UNIX-2 I could have more types of objects, but the fact that they're defined independent of the programs means that I will still be "hoping the receiving process understands" when I give it data from arbitrary programs.
Suppose I relax this a priori object mandate above to allow programs to extend the base IPC object types. But then, programs that do so will only compose with programs that implement IPC handlers for their extended object types. In this scenario, I can expect there to be disjoint sets of programs that compose with one another, but not with others. This is effectively what happens in SOA/microservice architectures: you get a set of programs that are composible only with programs that speak their (arbitrarily-structured) messages (the set of which is much smaller than the global set of SOA/microservice programs).
My point is, trying to enforce OOP on IPC will take away universal program composibility, which is the killer (if not defining) feature of UNIX.
Or the output of a 'uniq -c', you can then 'sort -g' to order lines by the number of occurrence, but if you want to take the top 5 lines and discard the counts with 'cut', you need whitespace transformations in between. (AWK would be an alternative to cut that performs the whitespace conversions on its own, but AWK is a full blown programming language, so one may as well have something that deals with dictionaries, arrays, etc, as input types anyway).
All this is to say that the untyped bytestream relies on conventions in Unix to make the bytestream useable between composable programs. These conventions are adequate for current uses, but show some weaknesses, and suggest that perhaps there are additional conventions, that if sufficiently simple, could be used to build composable programs that don't need to understand a format that is particular to just one program.
I totally agree that objects (meaning data + associated data-specific code) are probably overkill, though optional object interfaces may be nice if the programmer is willing to pay the computational cost, like one does when using AWK over cut. And I definitely think that inheritance is an idea best to avoid for data.
Not necessarily. You could pass S-expressions instead of bytes. Parsing would be much easier, and there would be no loss of generality.
which is basically the all-mighty-yet-way-too-often-violated SRP [1], with the context scaled up a bit from fuction/class/... to program
[1] https://en.wikipedia.org/wiki/Single_responsibility_principl...
Nowadays, the only places where OS research seems to be alive is in cloud, embedded and real time OSs.
http://herpolhode.com/rob/utah2000.pdf
There's some pretty brutal truths here.
See the 10th question.
Thanks for posting this.
That would have put an end to others like Microsoft, Apple etc from taking all these innovations and then further "innovate" with 'phones with rounded edges' or 'performing an action on a structure in computer-generated data', patent them and extort money out of free software. Not that there was any way they could have known that.
Are you aware that Apple's OS X is actually based on the original UNIX source code? There's nothing proprietary about that.