Monday, August 07, 2006

Down at the coal-face

Over the weekend I sucessfully rewrote a key part of the unknown place matching code in C. There is a lot of C in CanalplanAC (about 34000 lines) but these days very little programming takes place in it. Instead, I do almost all my development in the custom basic-like scripting language that this C code implements.

But as I mentioned before, place matching was getting slow, and to add matching of newly added places would hvae made it even lot slower. So a added a new "placematch" function that can be called from the scripts and which returns a list of places that match according to the specific pattern passed to it.

This is a great example of the tension between compiled and scripting languages. I can develop at about 5 to 10 times the speed in my scripting language than I can in C, but C runs at between 10 and 100 times as fast. Nearly always the first of these is more important than the second.

There are a couple of bugs in there - including one that has manifested itself twice today and which I cannot duplicate (CanalplanAC mails me when it fails, including all the input paramters so that I can reproduce the error). This is very odd and may keep me busy in the future - watch this space.

I also hope to start writing a bit about things other than the deep workings of the code - although as that's most of what I'm doing at the moment, it's not that likely to change - unless you tell me otherwise!


Post a Comment

<< Home