On Tue, Feb 1, 2011 at 9:51 AM, <[email protected]> wrote: >However, the Plan 9 code (at last that under /sys/src/cmd) > doesn't seem to make use of iterators, string objects (or even > object-orientation), modern string parsing routines, etc.
There's a reason it does not use that stuff, and it may not be what you think. That said, why are you thinking in terms of writing in C anyway? If you're going to put a lot of work out, why not use a modern language in which strings are actually a first class object, that has garbage collection, and so on? I don't see how macro foo is going to make things all that much better. You're still stuck with C. > > It's probably worth noting that higher-level code abstractions are > probably more useful in userspace code than in the kernel. This is > partly for reasons of performance, and partly because the kernel is so > much closer to the hardware. The Linux kernel, for example, is still > largely written in old UNIX-style C. It wasn't even until series 2.5 or > so that the Linux kernel became palpably object-oriented. Actually, Plan 9 kernel is palpably object-oriented in a very real sense, if you consider the whole. The plan 9 devices and servers are all accessed via a common interface, and kernel and user objects can be interchanged -- consider that one can put a custom IP stack in place just by mounting on /net. I've worked with "object oriented" operating systems written in C++ that were far less object oriented than Plan 9. Over the years I've come to believe that whether a system is object-oriented does not always depend on the language it is written in. In fact given some of the C++ code I've had to work with I almost wonder if it's not an inverse relationship ... thanks ron p.s. If you're going to rewrite /bin, maybe it's time to look at Go?
