This doesn't mean that you must use C or C++, but assuming that you can always rewrite the slow parts in C or C++ is inviting disaster.
I don't know what the first non-C practical OS will look like, but I hope I live to see it. I can't believe in 2011 my OS is still getting buffer overflows and memory mismanagement and all of the foibles that despite everyone loudly declaring is all the programmer's fault and not the langoage's fault, still seems to follow the language around like dog poo stuck on its shoe.
A quick google finds this post mentioning a release http://objectmix.com/python/179041-unununium-os-0-1-rc2-rele...
"implemented features include a fully functional Python interpreter, floppy, ATA, and ext2 drivers written entirely in Python."
Would love to find source code for that actually.
1. Structural - designing the top-level system to perform its work with minimal activity.
2. Local - Calling conventions, component-local algorithms, etc.
Now this is fuzzy for the same reason that one man's strategy is another man's tactics. But the gist is simple: you don't tighten the bolts on the system until you have it in the right shape.
Local optimizations are easy to do b/c you can usually pull them out of a textbook, or figure it out by looking at one or to parts of code. Structural optimizations require an understanding of the system performance as a whole -- possibly allowing some suboptimal local behavior. Sadly the way I've mostly seen is super-tightening the bolts and having the system slowly distort from something suboptimal but flexible into a contorted, performs-ok-but-dont-touch-it terrible beast. That's the sort of optimization that's the root of all evil.
Example: I have a webserver, with a table of regexs mapping to handlers. The handlers can be static assets in files or dynamically generated in code.
Local optimization: I notice that after URL pattern match, my static assets are read through normal stdio file I/O. I use sendfile or whatever's the new hotness on my platform to make it fast.
Structural optimization: I notice that the majority of my hits are static for a small number of files. I write a new webserver (say static.foo.com) for them specifically, that looks up the URL in a hash table for an in-memory copy of the file. I just ping it with SIGHUP when I want to invalidate the hashtable's values.
"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil"
Note, "small" and "97%".
That means that you should make the right large-scale decisions before you code. Or measure.
Even more so, the PyQt application had a NumPy backend and again, it performed flawlessly. The Qt application had a C++ backend that did similar computations as the Numpy backend, but with a much more painful programming process.
So in that line of thinking, I am a big proponent of having a dynamic language as frontend for low level libraries. Both Qt and the Numpy core are plenty fast for what they need to do and having a dynamic language like Python as a frontend makes programming very convenient. The best of both worlds, really.
I have never experienced Python being the bottleneck of my algorithms using these libraries.
Still, for the average programmar 'top-C++' makes a miserable language. Want to write a simple class? You have to make a separate header file and decide what methods to inline/make virtual, etc. Want (binary) compatibility? You'll have to worry about things such as PIMPL and d-pointers.
It's a low-level language, and low-level issues will always leak into higher-level subsets. And why should one go through the effort? The old mantra "write in a higher language, rewrite what is too slow in C/C++" works fine.