archives

What is so bad about compiling?

No we haven’t lost our mind! We know that compilers and the languages they represent are the absolute foundation of computing. Compilers are so basic and originate so early in the history of computers it is easy to forget what a compiled language really is: A compiled language is simply an extension of the machine codes defining the register machine. As long as we insist that a language compile we are insisting that the register machine must be our computing architecture. This is because no matter how we disguise it the basic properties of the register machine will leak through into any language that must compile directly without an intervening virtual machine.

The property we are most concerned about is “flow”. We read and execute one instruction after another in order. If we need to execute a different string of instructions we use conditional jump instructions. On a higher level a conditional jump would be a goto statement with a label. Goto’s are very powerful but may lead to what we used to call “spaghetti code”. It can be impossible to “see” where the program is going next. We bring this up because “spaghetti code” still lives in the form of if/then/else statements, but is more subtle.

Another example of the “flow” problem is that the code must be analytic. The register machine has no built in way to back up or recover from errors. We can and must check for errors but the only option then is usually to terminate the program. The logic has been broken! The analytic assumption is reasonable as long as the program is not connected to the external world somehow, perhaps through user inputs, sockets, or external activity. The need to be analytic leads the “fortress” mentality; radical steps to ensure that the code is analytic.

A solution exists that we like to call synthetic logic. A synthetic logic is a set of event rules with a works or doesn’t work logic. Synthetic logic is a logic of possibility; the event X is said to work if events A, B, and C work in order. If something goes wrong the system simply backs up to the starting point automatically without any specific error processing. Synthetic logic can work along with an analytic true or false logic. The dilemma is that synthetic logic in whatever form will require a virtual machine to execute because it will be based on backward or forward chaining control. In other words it won’t compile on a register machine.

It seems to us that language designers must address the larger problem of languages that are hard to compile or impossible to compile. These languages usually don’t make it into prime time because they don’t compile. If we continue to insist that mainstream languages compile we will simply be getting more of the same subtle problems. In the search for the ultimate language the compiler should not be a consideration. Any language concept can be implemented as a virtual machine. With the fast computers that we have today this may be all that is needed. If that language should actually turn out to be the ultimate language then there would be plenty of money to design a machine on which it could be compiled directly.

2005 ICFP Programming Contest

Think your favorite programming language is the best one out
there? Put it to the test in this year's International Conference
on Functional Programming's annual Programming Contest. The
contest is coming up in a little under 4 weeks and we have just
released more information (including a live cd, mailing list, and
prize details) to the web page, at:



http://icfpc.plt-scheme.org/



This year's competition rewards programmers who can plan ahead. As
before, we'll announce a problem and give you three days to solve it.
Two weeks later, we'll announce a change to the problem specification
and give you one day to adapt your program to the new spec. And you
guessed it: the second half will be worth considerably more than the
first.


Important dates:

  • Problem announced: Friday, June 24th, 9:00am CDT (UTC-6)
  • Initial entries due: Monday, June 27th, 9:00am CDT (UTC-6)
  • Revision announced: Saturday, July 9th, 9:00am CDT (UTC-6)
  • Final entries due: Sunday, July 10th, 9:00am CDT (UTC-6)

ICFP Contest Organizers


icfpc@plt-scheme.org