snoofle over thirty years of professional experience designing and developing high performance parallel transactional server side systems in "c", "c++" and java on *nix and windows platforms for military, financial and health platforms. bachelor's in geological engineering and masters in computer science. 




we<u+2019>ve all inherited legacy systems. you know the sort; 20 years old, more than 50,000 lines of code, poorly designed - even for its time, completely undocumented externally and useless code comments within, mangled beyond recognition due to countless developers making myriad ad-hoc changes upon changes and so-on. now imagine such a system written in a tool that<u+2019>s been around for nearly half a century, but rarely used for the intended purpose of the application. 




reg worked for a firm that built space-rocket related applications; specifically an ada compiler, written in snobol , for a 15+ years obsolete legacy processor used in the rocket. the system itself consisted of more than 100 spitbol (a speedier compiler of snobol) programs, most of which were written by one guy nearly four decades ago, barry. barry was a former sixties hippie-turned-coder. though long since retired, he had been called back to active duty to try and help decipher what this thing does. 




the code is full of comments explaining what each block does, but not why . nor were the comments up to date with what the code actually did, which was one set of <u+201c>bugs<u+201d>, in addition to the more normal set of errors. of course, in those days, nobody wrote unit tests (was it even possible to write test suites for snobol?) some of the more interesting phenomena included mangled memory addresses, incorrect hex/decimal conversions, offsets disappearing, seemingly random mangling/unmangling/remangling of variable names, etc. 




reg<u+2019>s ongoing project was to replace this mess with a shiny new ada compiler written in python. 




along the way, reg had to deal with all the control flow of snobol (e.g.: goto<u+2019>s), on-the-fly execution of strings containing arbitrary snobol code, the immediate-value-assignment operators (<u+2018>.<u+2019> and <u+2018>$<u+2019>) and pattern matching that would reduce a regex-wizard to a quivering mass of jello. 




even barry, the tie-dyed, retired, hippie could no longer decipher what the internals were doing. maybe he<u+2019>d just fried too many neurons. reg couldn<u+2019>t get any further- maybe he just wasn<u+2019>t smoking enough marijuana to understand what the hippie had done. reg decided to simply try to replicate the output of the legacy system. this was accomplished by running both systems on the same input and doing diffs. 




this project started long before reg joined the firm, and will probably be going strong long after he<u+2019>s gone. 




reg got the number of diffs on the output down to less than 1,000. that might not sound great, but almost all of them were caused by bugs in the legacy code. 




now his toughest job begins: explaining to management why success must be defined as about 1,000 differences in the output between the legacy and replacement systems, and, more importantly, determining whether correcting the output of the previous systems will cause the rocket to act in an undesirable manner. like exploding. [advertisement] manage it infrastructure as code across all environments with puppet . puppet enterprise now offers more control and insight, with role-based access control, activity logging and all-new puppet apps. start your free trial today!
a snobol's chance
snoofle