On LEGO bricks and OS design

It is not always that we can explain our deep attraction to particular patterns be they real or imaginary. To some extent that is exactly what makes art so subjective. But even in the realms of programming these matters hardly become any clearer. Why does the majority of computer scientists and programmers find recursion particularly exciting ? Well, I guess we can speculate all we want but it won't get us any closer to really answering this question.

Now, as I've told everybody time and again -- I love Plan9. I think its the most elegantly designed and implemented OS since the dawn of UNIX. And anything else (be it Linux or Solaris) just pales in comparison not only in the pure artistic sense, but also in a number of very practical areas. I truly believe that Plan9 and its ideas were somewhat ahead of their time and anybody seriously considering a fully networked world of devices ranging from one bit sensors to full fledged humans must study Plan9. Its like that old LISP saying: "If you don't know LISP you're bound to reinvent it. Poorly".

An excellent introduction into Plan9 philosophy does a nice job of explaining the 3 key ideas on which Plan9 is built:
    "The view of the system is built upon three principles. First, resources are named and accessed like files in a hierarchical file system. Second, there is a standard protocol, called 9P, for accessing these resources. Third, the disjoint hierarchies provided by different services are joined together into a single private hierarchical file name space. The unusual properties of Plan 9 stem from the consistent, aggressive application of these principles."
but it does nothing to help understand why so many smart people find them (and especially the first one) particularly exciting and somehow very powerful.

It took me a number of years of thinking about it, one trip to Madrid and a conversation with the brilliant computer scientist named Nemo to finally come as close to a conscious explanation as one can get.

Its rather simple, really, as an application developer my ideal world would be the one where I can reuse useful components/services literally in a manner of LEGO bricks. The world where a component that gives me a "binary editor" capability would be equally easily accessible from my debugger, my editor, the application I use to edit fonts, etc. Ideally I shouldn't even care about where component resides or what language/infrastructure it is implemented in. A SOA of sorts.

Do we live in an ideal world ? Not really, but before I state why Plan 9 comes as close to it as one would hope to get, lets look at some of the "proposed" solutions to this universal reusability problem.

Java comes to mind right away. Its widespread and it abstracts you sufficiently enough from the outside world, so that you don't have to care how to create threads or windows -- its all part of the grandure API. It also provides the level of reusability I've mentioned via [Net]Beans and such. However, the unbelievably high price you have to pay for this is that you absolutely have to remain in Java's world. Both from an VM and from an API standpoint. Suppose I even have that binary editor module coded as a [Net]Bean and it works fine in that framework, but can I get to it from my favorite editor ? From my favorite debugger ? From a command line prompt ? No! I have to use Java and Java alone to "glue" this piece of functionality to the rest of my working environment.

It is sort of like having LEGO bricks which not only do not stick to each other if you put 'em together, but require a particular brand of glue to form any sort of complex structure. The glue called Java in my previous example, or the glue called C language, or what not...

Now, the question becomes is it even possible to have anything at all which would let my LEGO bricks just stick together ?

My answer is -- yes and it is called files!

Files are my true universal glue, the lowest common denominator of sorts, the one and only API present in absolutely \*all\* common programming languages and systems.

It takes a bit of time to realize just how far the lack of files as a universal glues pushed various developers. Do you know that when you do "getline a < /inet/tcp/lport/rhost/rport" in (g)awk the right thing happens ? Do you realize how much extra code was duplicated and how many bugs were reintroduced ? Same question about all these jolly Java APIs -- sure its fun to reinvent the wheel, but you should at least start from wood, not from carbon molecules...
Comments:

I really liked to read some small notes about Plan 9, the new bell labs Operating system, If you know more about that please tell. I've just seen the small video "living linux," and your demonstration about the Sun performance analyzer. My opinion is, under Linux the intel C++ compiler is a great alternative. If I want some feeling of what C++ code does, I think the Visual studio from microsoft together with rational rose purify plus gives me a new and helpful point of view. It would be very interesting to se a small demonstration of a microsoft programmer using 1) visual studio, 2) rational rose purify plus, and the linux programmer using your performance analyzer. Not as a contest but as a means of showing the visual statement of the performance analyzer for someone who is used to microsoft tools. Best regards Morten Gulbrandsen

Posted by Morten Gulbrandsen on July 31, 2006 at 07:24 AM PDT #

Hi Morten! > I really liked to read some small notes about > Plan 9, the new bell labs Operating system, > If you know more about that please tell. I plan on posting quite a few thoughts into my "Elegant Computing" blog section. And not only on Plan9 but on PlanB as well. Stay tuned! :-) > My opinion is, under Linux the intel C++ compiler > is a great alternative. True. PGI and PathScale are pretty good as well. However, only Sun Studio is 100% absolutely FREE It is FREE as in BEER, where Intel and everybody else's compilers are for a FEE. > If I want some feeling of what C++ code does, I > think the Visual studio from microsoft together > with rational rose purify plus > gives me a new and helpful point of view. Good point. However, I don't particularly like Visual Studio because of its disregard of ISO Standards. C++ language it accepts is not what is mandated by ISO and hence when you're using it you never know whether porting your code to a different compiler will require significant [re]work. > It would be very interesting to se a small > demonstration of a microsoft > programmer using 1) visual studio, 2) rational rose purify plus, > and the linux programmer using your performance analyzer. Well, personally I would certainly accept this challenge on the Performance Analyzer side. If you're up to it on the Visual Studio/Rational side -- lets shoot a video of us racing. I'm dead serious. ;-) Thanks, Roman.

Posted by Roman Shaposhnik on August 23, 2006 at 04:35 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

rvs

Search

Top Tags
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today