C
ATS
(
TM
) P
ROGRAMMING
L
ANGUAGE
O
VERVIEW
As revised 2006.08.23
Bionic Buffalo Tech Note #84
Security:
Unrestricted
....................................................................................................11
1. Philosophy and Motivation
The C programming language is not far removed from a portable assembly language. While it cannot
take advantage of many features specific to some CPU designs, it allows the most common
programming tasks to be programmed close to the metal. Good optimizing compilers often make typical
C code almost as efficient as, if not more efficient, than typical assembly language code. Compilers for
C are nearly ubiquitous, available for almost all common platforms. Partly for these reasons (but also for
historical ones), C is widely used in operating system kernels, embedded systems, and in other
applications where added performance and efficiency outweighs the spartan feature level of the
language.
Attempts have been made to improve on C, most notably C++. The C++ language has the good features
of C, with additional ones, and can be as efficient as C for lowlevel tasks. It probably would be more
widely used for kernel and embedded applications, but for the fact that it arrived later and has taken
longer to develop. Unfortunately, C++ compilers are not yet available for many embedded target
environments.
Still, at Bionic Buffalo we found ourselves wishing both C and C++ had some additional features, and
wanted to add them to the C and C++ languages. The result is Cats, for “C, and then some”.
We especially liked some features of Perl and C++. For our work, we needed a strongly typed language,
and we needed a compiled language. The features we selected are described below.
2. Design Principles
It is impractical to write new compilers for all of the platforms in the world, so we elected a different
approach: a precompiler. The Cats precompiler translates Cats into C, with the added rule that every
valid C program must also be a Cats program. Thus, C is passed through the precompiler unchanged,
and its execution is identical. This also allows Cats and C to be mixed. Since Cats is translated into C, it
can be used everywhere C can be used.
The exception we made to the above was in keywords: the precompiler recognizes some new keywords.
If an existing C application avoids using these new keywords, then it should pass through the Cats pre
compiler unchanged.
Since Cats is translated into C, we could use Cats in house for development, then hand C code to our
customers, without having them suffer directly through the development of Cats. Also, we didn't want
customers with source code to depend on a tool they didn't have. To make this easier, we made sure that
Copyright 2006 Bionic Buffalo. All rights reserved.
File tn0084; Modified 20060830 08:00:17
http://www.tatanka.com/doc/technote/index.html
Email:
query@tatanka.com
Page 2 of 12