Posting 10-year-old code to HN is always a little embarrassing, but please feel free to be brutal. I'll live. :-) I was definitely way too in love with the preprocessor back then.
Here's the corresponding Python code, from shortly after it hit 1,000 lines in late 2001:
I like the Python code rather better, if only because there's so much less explicit memory management. The actual ideas stand out clearly, and there's just so much less code to read. In most cases, I'd happily sacrifice the performance.
https://gist.github.com/937200 (two sample files, totaling slightly less than half the project)
Posting 10-year-old code to HN is always a little embarrassing, but please feel free to be brutal. I'll live. :-) I was definitely way too in love with the preprocessor back then.
Here's the corresponding Python code, from shortly after it hit 1,000 lines in late 2001:
http://hg.python.org/cpython-fullhistory/file/7b2d701ec404/L...
I like the Python code rather better, if only because there's so much less explicit memory management. The actual ideas stand out clearly, and there's just so much less code to read. In most cases, I'd happily sacrifice the performance.