Purpose-Built Languages in Systems Design

A couple of weeks ago I attended the Industrial Partners Program symposium at my alma mater, Brown University. For the May symposium Brown invited back a collection of former teaching assistants from the Operating Systems course (cs169), including myself, Bryan, Adam, Eric, Matt, Jeff, and Jason for a thoroughly enjoyable day of talks. The host was Professor Tom Doeppner, who has presided over this amazing and unique course for more than twenty years now. Tom gave a fabulous presentation of the history of the course to start the day, with many former students in attendance, and it really struck me how effective the course has been at constantly reinventing itself along with the evolution of operating systems in industry, thereby empowering both TAs and students to engage in some incredible design and implementation challenges along the way. Tom deserves an enormous amount of credit for this, and for me personally this course is a major part of the reason I work in an operating system group today.

For my talk, I presented a three-part discussion of Purpose-Built Languages in Systems Design. The topic is impossibly broad, but I thought it would be fun to take a look at a different side of systems than is usually discussed and look at how little, bizarre languages have contributed to the evolution of systems, in particular UNIX. In the first part of the talk, I traced the evolution of the original UNIX debugger from its predecessor ODB on the PDP-8 through db and adb up to mdb, the rewrite I contributed to Solaris 8 and in use today. Purpose-built languages may have all the elegance of pond scum, but they also have the resilience of pond-scum when attached to the grout on your bathroom tile. This one has now lasted more than thirty years, and that is quite an achievement for any language. (Side note: I would love to hear from anyone who has experiences with ODB, or early DB or ADB to share.)

In the second part of the talk, I talked about the evolution of the D language we designed for DTrace. In particular I think one of the most powerful design principles (illustrated also in part one) is how purpose-built leverages can leverage syntax and semantics from existing paradigms to speed their adoption. This is entirely common-sense, but achieving it in implementation can be quite difficult, especially as the new language will naturally extend the basic form in some areas while pruning it in others, all while attempting to achieve some rational semantics which hopefully don't violate those of the original.

In the final part of the talk, I showed some examples of what I called "mutants": purpose-built languages that evolve as a mutation between two or more existing languages, sometimes by attempting to form a bridge from one to the other (as in the case of preprocessed language front-ends) and sometimes by, well, just being plain weird. The most bizarre is the mutation of Forth and SPARC assembler used at Sun for the Open Boot PROM source code -- here Forth words are redefined to cause the generation of in-memory SPARC opcodes, and the OBP image is created by taking a core dump of the interpreter after all the files have been loaded.

At the end of the day, we have an impromptu panel to discuss, among other things, how systems should be taught in universities. One point I feel strongly about is that it's vital to give students as many tools for their mental toolbox as possible to be effective in designing and building larger-scale systems: it should mandatory to take an OS class and a compiler class, whether your intent is to be a compiler-writer or a kernel programmer. They both have a deep influence on the other, and I am constantly amazed in industry how rare a good working knowledge of both areas is. From the OS side, development of languages, in particular little ones, has played a central role in the evolution and adoption of UNIX, and is vital to its continuing growth by allowing us to more easily operate on the set of abstractions exported by the kernel.

$q
Comments:

Post a Comment:
Comments are closed for this entry.
About

mws

Search

Categories
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
Bookmarks