Updated 2004-09-28 23:21:23

Sometimes you need a sanity checker.

I've got over 3GB of binary data files to trudge through. The original code is in C++ -- there is an error somewhere in the code. Or, is the data just corrupted?

A surprising (for me) use for Tcl: Sanity checking existing C++ code.

The approach is simple and can go two different ways:

  • Cleanroom re-implementation of the code (based on understood data file format) to check correctness of original code and data file integrity
  • A re-implementation using the original code as a guideline --- additional introspection and stepwise tweaks to check correctness of original code and data file integrity

The really interesting end result: A reference implementation of the binary data file reader. (Change the file format or the C++ code and you need to validate it with the Tcl implementation).

Ah, the many uses...

Plusses:

  • Tcl was very easy to bind to C based data decompression code
  • Large file support seamless (compared to C/C++)
  • binary is your friend
  • Tclkit made it easy to deploy to remote machines (and share w/ co-workers)

-- Todd Coram