Among the comments that are listed in my recent post about On Programming: Compiler Experts Discuss The Lost Art of Programming in Assembly Language, you can find the following challenge from David Corbin, President / Chief Architect at Dynamic Concepts Development Corp.:
I defy anyone to pick a hardware platform, and programming language; then provide a small (one page) sample of code, and be able to COMPLETELY describe what happens when the code executes. I have given this challenge many times since the time I was humbled by the same challenge back in 1978; never once has a person completed it – nor should anyone be expected to.
As it happens, I solved the problem a decade before Corbin first posed the question.
In the late 60’s I was a sysadmin for the CDC 6600 — then the world’s largest supercomputer — at NYU’s Courant Institute of Mathematical Sciences (CIMS).
Early one June day I was told that the fiscal year would end a few weeks later, and that I should make sure to use up all the time that had been allocated to me, to show our sponsors that we made full use of our funding.
I thus wrote the following FORTRAN program.
PROGRAM MAIN 10 GOTO 10 END
I then ran it several times with different time limits until the account went dry.
Here is my complete description:
The program wastes time in an efficient fashion.
Though some may quibble with the language, I think the intent is clear, and that any programmer can describe what happens when the program is executed.
One page is more than enough. Three lines suffice.
The program ran correctly the first time.
I thought of rewriting it in assembly language, to make it even more efficient using an in-stack loop.
However, that would have been a waste of my time …