That a clean system for separately compiled modules appeared in Modula-2, a programming language designed by Niklaus Wirth in 1978, but not in the 2011 C++ standard…hmmm, no further comment needed. But the successor to Modula-2, Oberon, is even more interesting.
With Oberon, Wirth removed features from Modula-2 while making a few careful additions. It was a smaller language overall. Excepting the extreme minimalism of Forth, this is the first language I’m aware of where simplicity of the implementation was a concern. For example, nested modules were rarely used in Modula-2, but they were disproportionately complex to compile, so they were taken out of Oberon.
That simplicity carried over to optimizations performed by the compiler. Here’s Michael Franz:
Optimizing compilers tend to be much larger and much slower than their straightforward counterparts. Their designers usually do not follow Oberon’s maxim of making things “as simple as possible”, but are inclined to completely disregard cost (in terms of compiler size, compilation speed, and maintainability) in favor of code-quality benefits that often turn out to be relatively marginal. Trying to make an optimizing compiler as simple as possible and yet as powerful as necessary requires, before all else, a measurement standard, by which both simplicity and power can be judged.
For a compiler that is written in the language it compiles, two such standards are easily found by considering first the time required for self-compilation, and then the size of the resulting object program. With the help of these benchmarks, one may pit simplicity against power, requiring that every new capability added to the compiler “pays its own way” by creating more benefit than cost on account of at least one of the measures.
The principle is “compiler optimizations should pay for themselves.”
Clearly it’s not perfect (the Oberon compiler doesn’t make heavy use of floating point math, for example, so floating point optimizations may not speed it up or make it smaller), but I like the spirit of it.
(If you liked this, you might enjoy One Small Step Toward Reducing Programming Language Complexity.)
Categories: Blogs Programming in the 21st Century
Erlang on Twitter
» SergeStinckwich (Serge Stinckwich): RT @NotDoctorOk: Yes, the debt to the Smalltalk 4-pane browser and its “method categories” *is* pretty obvious, isn’t it? http://t.co/KKKgf…
RT @NotDoctorOk: Yes, the debt to the Smalltalk 4-pane browser and its “method categories” *is* pretty obvious, isn’t it? http://t.co/KKKgf…
» Graceila123 (Just call me Grace): Erlang =)) bukan manis, tapi lucu. Apalagi klo keliatan giginya”@notesSAHABAT: #NotersOfTheDay siapa temen lo yang senyumnya manis banget ?”
Erlang =)) bukan manis, tapi lucu. Apalagi klo keliatan giginya”@notesSAHABAT: #NotersOfTheDay siapa temen lo yang senyumnya manis banget ?”
» KuldeepSinhC (Kuldeep Sinh Chauhan): #Erlang_and_OTP_in_Action, now u r here. Let’s see what wonders we can do together!!! http://t.co/PXmNfcVLrh
#Erlang_and_OTP_in_Action, now u r here. Let’s see what wonders we can do together!!! http://t.co/PXmNfcVLrh
Number of aggregated posts: 10648
Most recent article: May 14, 2013
» Moraru on This is Why You Spent All that Time Learning to Program: It is true that computer science was a pain in the back at time that i’ve had to learn it…
» Commercial hand dryers on Couchbase Meetup at new HQ: Buy online from here where you will get so much of variety in Commercial hand dryers for people. If you…
» Fort McMurray Homes on Motivated Reasoning and Erlang vs Python vs Node: I don’t really understand why this post is motivational? I don’t even see a post, just a title. Fort McMurray…