1. Compilers 101 Coding Competition

This is a chance for you to show your stuff! The first round of the coding competition started on the weekend of March 18th 2006 and is currently ongoing (we hope to have a look at the first round of entries in mid-April), but anyone is welcome to join in at any time as this is open-ended and with luck will keep running for years.

(If you somehow came to this page from somewhere other than the compilers101 group at Yahoo, you probably should sign up for that group as that is where discussions about the competition will take place)

The task is to write a compiler for the Tiny language. The language is defined by a reference implementation, written in C, supplied by Peter Gray. Reverse engineering the language specification is the first part of the problem!

We will post the common consensus of the language spec on this board, but you may find places where our spec is wrong and need to correct it. Remember the original code defines the language, so arguments ought to be solvable with a test program! In case of unresolvable ambiguities, you can do whatever makes writing your compiler easier and more elegant in the short term, and in the long term we'll discuss it on the group and make a final decision. (Or if Peter Gray is available, we'll ask him what he intended when he wrote it ;-) )

There are really no hard and fast rules for this competition; the main point is to let you try different compiler techniques and produce a small and understandable, well-documented example that we can use to teach compiler techniques.

All entries will be displayed on our site. If you have regrets afterwards and think of a better way of implementing something - no problem - just resubmit an updated version.

We'll showcase the 'best' entries (as judged by your peers) but we'll also highlight one example of each different technique submitted, so if you want to stand out from the crowd, pick a compiler technique we haven't seen before to expound upon! You can put effort into only one aspect of your compiler if that's where your expertise lies - for example parsing technologies, or code optimisation, or error-checking and diagnostics - whatever you find interesting.

The only hard rule is that you give us your best effort - please write elegant code and document it extensively. If you're one of these "obfuscated code" hackers and your thing is to write the smallest possible compiler, that's OK too - but do document it separately in an expanded version (as Fabrice Bellard did with OTCC).

Although we're calling this a competition, there's no actual prize at the moment except the approbation of your peers. Maybe that may change in the future if this takes off (when we get to a good few entries I'll see if I can get some sponsorship from some compiler companies, maybe something like a scholarship award once a year for the best first-time compiler from a new author)

This is all about having fun, so let's go!

You are welcome to document your work-in-progress, while you are working, on this wiki, for the benefit of onlookers.