Darius Bacon ([info]darius) wrote,
@ 2001-08-01 09:34:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
haste
I was going to skip the ICFP contest this year, but Luke was talking about his entry-in-progress on IRC Sunday morning and I couldn't resist joining in. With about 6 hours to go I got started on a checker for his entry, writing in C for the sheer perversity of coding the most correctness-critical component in a horribly unsafe language. (Luke's team's code was in Erlang; they'd made a very nice little lightning entry that he was extending with fancier optimizations.) Once the checker was working, Luke was away, leaving me without anything very fun to do, so I decided what the hell and started on a full submission of my own.

How it works:
  1. Reduce the input to a direct representation of its meaning. This is where all our optimization happens, sad to say.
  2. Bleed tags into any whitespace characters from the immediately preceding text. This factors out the `space context' so the output routines don't have it to deal with it.
  3. Write out each character in turn, surrounded by all the tags that decorate it. Well, it's not quite that dumb: it cancels out matching close/open pairs.
There's also a driver script adapted from the Erlang entry that tries to recover from obvious blunders.

It was fun discussing optimization techniques with Luke, though I didn't code any up in the time available. Here's the entry as submitted, embarrassing warts and all:

icfp2001-demoncrat.tar.gz

I've been afraid to test it further after the deadline -- what if I found a bug? Leave it alone and pretend it's all right.



(Post a new comment)

ICFP
(Anonymous)
2001-08-11 11:46 pm UTC (link)
Congrats on getting through the elimination round!

(Reply to this)


Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…