History of the Cats Pre-Compiler
Cats started with my annoyance at the amount of code required to do certain simple things in C. For instance, in Perl, I could write
which changes all instances of "horse" to "zebra" in the
I decided to create a preprocessor, which became more complicated and quickly became a pre-compiler, which would recognize some of these constructs, and convert them into C. Then I could write a statement such as
and embed it directly into a program which was otherwise
standard C. Then I thought, it would be nice to have a
The task turned out more difficult than first anticipated, because the only way to get it right was to have the pre-compiler understand much of what was going on in a C program. For instance, strings needed to be released when leaving the block in which they were defined, so the Cats pre-compiler had to understand the block structure of a C program, and so on.
By creating standard C, I didn't have to write a real compiler: there are C compilers for almost every platform. Also, I could write in Cats for customers who wanted C, and just give them the C output. Finally, C is, in practice, more or less a high-level assembly language, with portability, so I could do almost anything I could do in assembler, without much loss of efficiency.
Cats reached version 3, but that implementation was never finished. There is a Cats 3 manual.
After adding a lot of features, I'm still not completely satisfied with the language. Now I'm working on version 4, and am tempted to discard backward compatibility. My current list of features to be added includes:
Another idea, which isn't close to the head of the queue and may be rejected completely, is to generate Java instead of C, to accomodate platforms which prefer Java. Ignoring the Cats extensions, it would become a C to Java converter.
Copyright 2017 Michael Marking. All Rights Reserved.