So what language would you recommend for a class in operating systems? Isn't there some value in seeing how C developed and why it developed?
Don't get me wrong: I think C and Unix should be studied, but as much as for what its authors screwed up as what they got right. Unix represents both the best and worst of hacker culture: a working system whipped together in little time and even less resources while the Real Development Project next door (Multics) was burying itself beneath its own impossible weight, which promptly locks in all of its hacks, shortcuts, and plain bad decisions to plague the world for the next fifty years. C and Unix may be many things, but correctable and evolvable ain't amongst them. So yes, study them, but with a view to figuring out how to fix these larger failures (which are not only technical in nature, but logistical as well). That's how you really learn: steal the good stuff, dissect the bad.
Meantime, I'd suggest looking to other OSes like Oberon, L4, Minix, etc (and there's probably plenty even more exotic ones out there well worth chasing down and studying). And even Plan9, just to see how that learned from Unix's mistakes and approached the task of redoing it right.
Oh, and the other thing they'd do well to study is the
logistics of turning an OS (or
any project, for that matter) from academic curiousity to real-world product, because ultimately it doesn't matter if you write the greatest code on Earth if you can't get anyone to use it.
I suppose you could develop an OS using a Lisp Machine.
Already done.
I would definitely pick the highest-level language I could find. The only reason C gets picked is because C compilers have already been ported to every architecture under the sun, and because programmers like to pretend they're macho *******s by juggling live grenades. But really, if you're writing a kernel then you should be using the safest language you can (since any mistakes at that level
really screw
everyone's day), so even if it was just something like Cyclone then that'd be an improvement.
And I can't help wondering to what extent a robust declarative language such as ML might be applicable to OS development. At kernel level I suspect the Big Bad (i.e. state) is something that can't be entirely eliminated, only contained, but anything that makes behavior provably safer and more predictable has to be worth investigation. I'm aware of at least one experiment in this area,
House, though being a bear of very little brain it's not something I'm up on myself.
Heck, even Forth might be worth a go: fast, simple, and with an established history already. Perhaps students could even build their own platform to run it (tip: Burroughs mainframes were wonderful stack machines); with modern technology like FPGAs and CAD/CAM at their disposal, they wouldn't need to spend weeks hand-wrapping cheese boards so could get on with the stuff that's actually of value. (Yay, automation!)
I think there's value to studying all sorts of languages... assembly, C, C++, Pascal, Smalltalk, Lisp/Scheme, Erlang, Haskell, Scala, Prolog, and more. A good computer science program will introduce you to a wide variety of these languages and work more on how to think deeply about problems. It won't focus primarily on learning the preferred tool of the day... those go in and out of style on a regular basis.
Yes, it's the idioms, not the tools, that's the important thing. Languages are the tool by which we express ourselves. Mastering many different idioms - imperative, functional, relational, logic, dataflow, concatenative, concurrent, and so on - vastly expands and enriches our abilities, allowing us to adopt whichever one can best express a solution to the problem at hand. Alas, programming seems to be the one craft whose members frequently place far more pride in their ability to whang a hammer at absolutely
everything than in carrying a full toolbox.
There's such an incredible wealth of ingenuity and insight in the declarative programming world, I can't believe so many of today's programmers would be so thoroughly, determinedly, uninterested in anything outside of their tiny self-imposed cardboard box. They're supposed to be these great free-thinking visionaries and fearless techno-pioneers, yet many are such reactionary conservatives, so utterly averse to challenge or change, they make the John Birchers look like a bunch of screaming queens.
It's a paradox... but hey, more opportunities for the rest of us...
