The Cobra Team and the ICFP contest 2000

the contest

The ICFP programming contest 2000 was about writing a raytracer whose scene descriptions are written in GML, a language similar to postscript1 . In 72 hours. There were three completeness levels, called tier-1 to tier-3.

the team

In comp.lang.python, I found a posting by Cedric Adjih2 about participating with a solution in Python. We founded a team (later, Frederick van der Plancke joined us and contributed bugfixes).

development

We divided the task into two parts: Cedric worked on the raytracing engine, whereas I did the GML interpreter (and the packaging up, the name "CuttySark"3 , and the README-writing). At the end of the first day, lexer, parser and most of the stackmachine worked. During the second day, I added an optimizer to reduce unnecessary re-computations of function calls. The third day was left for bugfixes, of which surprisingly few were necessary for the program to render the sample images.

We ended up with a complete tier-2 solution with buggy additional tier-3 support.

python?

So, was Python a good idea? It depends. Our program runs a bit sluggishly4 . On my K6-500, it took5 sixteen hours for the dice image on the sample images page. If we had had more time (or perhaps more programmers in fewer mutually disjunct locations), we would have profiled CuttySark and rewritten the hot spots in C or C++, the usual practice when programming in a script language.

But on the other hand, the speed of development was even higher than I expected, mostly due to Python's comfortable high-level language facilities, the quick turn-around times (because we didn't compile), and the complete lack of time-consuming pointer bugs.6

our submission

Here it is for download, CuttySark, the final version.

the others

Now it´s clear that we didn´t win, which was to be expected. CuttySark is still the best Python entry in the contest7 .

We participated for fun, which it was.

vaguely related links

Footnotes

  1. If Adobe suddenly announces a PostScript3D standard, you heard it here first. (back)
  2. PhD student at INRIA, France (back)
  3. No Python program without a Flying Circus allusion. The Cutty Sark is a model ship built in complete darkness. (back)
  4. one entry was disqualified after rendering for days... Someone who was there claims it was a Python entry... (back)
  5. or rather, would have taken, if I hadn't supersampled the image by a factor of 4... (back)
  6. That means, I slept daily for healthy periods of time, nourished myself without instant pizza and continued with non-computer activities. (back)
  7. unfortunately that is because there were no other Python entries in the contest. (back)