Log in

ICFP 2008 Postmortem

The ICFP Programming Contest is one of my favorite contest. Sadly in the past few years I was not able to compete live. But this year the old team was back ! With Pierre in New York and motivated, we were able to have kick some martians' butts.

ICFP was always for us a reason to learn a new programming language. The first time was OCaml, two weeks before we choose the language and do our homework, but nothing beat getting your hand dirty with a short deadline to learn.

This years we decided to use Haskell (our team was named LazyMonkeys).
I am already pretty decent at it but it was a first for Pierre. Who by the way did a pretty good job. It was funny to see him use OCaml idioms like let in instead of the favored where, but I was never found of where too since it remove the ability to read the code top to bottom.

The contest was very interesting with unusually clear and short instructions, I did not even print them. You can read all about how you had to help a poor rover find his way home on Mars while avoiding the Martians here. It also had a nice range of possible progress from a simple steering solution to a more complex strategy.

At first we kind of doubted of our choice since we had to do real time analysis of a telemetry feed and I seriously consider switching to Erlang. But there is good threading support in Haskell so we stayed with it.

Our solution :

We have a very simple one based on fuzzy steering. With a thread managing the network, one for the motion planning and a last one for visualization.

We lost a lot of time on the network part. The task recommended to disable Nagle’s algorithm which was only possible with the more advanced Network.Socket. The issue that gave me a lot of grief was that on the OS X 10.5 when doing a gethost on localhost the first answer is a IPv6 address. Network.Socket does not seem to be able to manage IPv6 so it was difficult to debug the issue.

We used OpenGL for displaying our robot activities :
ICFP 2008
It was very helpful in detecting logical errors.

Summary, what we did wrong:
  • Did not have a comprehensive test bed to be able to measure our progress. Would have been very useful at the end when we try to tune our parameters.
  • Did not create a trigonometric/geometric module early enough
  • Discover that Aquamacs new version is way cooler that Emacs.app and spending 2 hours updating my .emacs

What we did right:
  • Create a SVN in advance
  • Build the OpenGL display, the one offered by the server was good enough for the first day but when we added more complex comportment we need more visual info.
  • Choose a robust solution
  • Made good use of Haskell laziness


September 2010



Powered by LiveJournal.com