Cat to C++ Compiler

I’ve just released a beta version of a public domain Level-1 Cat to C++ compiler at http://code.google.com/p/cat-language/downloads/list. This implementation bootstraps a Level-1 implementation of Cat from a Level-0 implementation. There are a hundred unit tests and only a handful of predefined functions so this is a very stable release.  

The translation is done without any type-checking. The resulting code is implemented using optimized polymorphic variant types (see http://www.ddj.com/dept/cpp/184402027 and http://www.codeproject.com/cpp/dynamic_typing.asp ) and stable fast-growing stacks (see http://www.codeproject.com/cpp/fast-stack.asp ).

For an updated list of primitives that now contains unit tests for all of the level-0 and level-1 primitives and better definitions see http://www.cat-language.com/primitives.html.

This release is intended to help people who are interested in possibly using Cat as a back-end for other programming languages. By using Cat as a back-end you get the following for free:

  • an interactive interpreter
  • a Cat to MSIL compiler (this is built in to the interpreter)
  • a Cat to C++ translator 

These are all projects which I have been developing single-handedly. As more people get involved, you can expect to see the number of compilers and translators to and from Cat increase quickly.

Other Cat projects by other people that I am aware of are:

  • a statically typed Cat to C++ translator
  • a Cat to assembly translator
  • a Cat to Omega (a dialect of Haskell) translator

I’d love to hear what project you are thinking of using Cat for. I just might be able to help out.

Leave a Reply

You must be logged in to post a comment.