A Forgotten Principle of Compiler Design
prog21.dadgum.com
prog21.dadgum.com
The lack of a clean module system in C++ is fairly directly a result of it's decent from C, a language designed earlier than Modula-2 and thus unable to learn from it. It would have been very difficult to add such a thing in the intervening time to the language given the required constraints of compatibility.
For example, the way Objective-C uses #import, is a bit like poor man's solution, but it already makes a difference in compile times.
There is no reason why a module system won't be possible to add in C++. That is why they are finally doing it.
Even C could benefit from one. The thing is, that most likely no one would use it, as many C developers are not used to module systems.
This principle may seem deep because there is an element of self-reference in it, but it is really totally stupid. It's nothing but an arbitrary benchmark that will reject lots of useful optimizations. It's not "forgotten" wisdom from the golden ages; nobody ever abided by anything like it.
It's cool that the optimizing Oberon compiler did manage to make its own object code smaller than that of the non-optimizing compiler, but I'll eat my hat if they started out by stating this "principle", rather than just noticing after the fact that it had happened.
Unless you count Niclaus Wirth as a nobody, this isn't true.
And in general what you wrote is not true --the gist is to be pragmatic about optimizations.
>* but I'll eat my hat if they started out by stating this "principle", rather than just noticing after the fact that it had happened.*
Well, eat your hat then, because Wirth was quite aggressive on following that route and he did state it from the beggining.
http://golang.org/doc/go_faq.html#What_is_the_purpose_of_the...
Any language with modules has fast compilation times. Turbo Pascal was just one of many languages already doing it in the mid 80's.
The only developers that can believe on this assertion, have only experience with C and C++ compilation times.
Here's a principal I learned from a fairly awesome compiler writer, Mike Hind of Jikes RVM (paraphrasing):
"Students often ask me how much speed improvement an optimization should provide to be publishable. If it speeds programs up by 10%, but will take six months to implement, that's not a good result. But if it can be done in a day, and improves performance by 0.5%, that's a great result".
Language simplicity is important. In some cases it's taken too far (e.g., the tiny nearly-self-bootstrapping dialects of Lisp), but a few outliers shouldn't discourage us from removing from our language(s) those non-essential elements of its syntax and semantics.
I learned a lot about compiler design by playing around in Native Oberon OS, while trying to implement an Oberon compiler.
Everyone that thinks it is not possible to implement operating systems in GC enabled, safe languages, that compile straight to native code, should have a look at the Native Oberon OS.
More information available here, http://www.ethoberon.ethz.ch/books.html
Actually (and I don't have a reference now, but) Guido van Rossum specifically rejects certain speed or other improvements to CPython because they add more complexity than they're worth to the interpreter/compiler.
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n334...
I hope it gets accepted.