FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
April 15, 2008

Cat: A Functional Stack-Based Little Language

(Page 4 of 4)

Cat Implementation

I have released several Cat interpreters as public domain code, which you can use and modify as you wish. The primary implementation of Cat is an open-source C# interpreter (www.cat-language.com) that performs type checking, type inference, and some basic optimization (function inlining and partial evaluation). It also has several extensions such as named parameters and MetaCat rewriting rules. The Cat language website provides an embedding of Cat in Scheme and an online Cat interpreter written in JavaScript. The JavaScript and Scheme implementations are a bit out of sync with the language specification and are intended only as demonstrations, but feel free to redistribute and/or modify them. I have also written a basic Scheme-to-Cat translator, in Scheme.

Conclusion

Cat has potential applications in many domains. I can envision a place for it in embedded devices due to its compact and expressive nature. I also believe that Cat would be useful in a computer-science curriculum as a tool for explaining the rudiments of computer programs. The immediate feedback you get viewing the stack after each instruction can be useful for instruction. My intentions are to use Cat as an intermediate language for translation and optimization for my other computer language projects, and as a language for teaching programming.

If you are interested stack languages and aren't familiar with Forth, a fun primer is a fully documented bootstrapping compiler by Richard W.M. Jones (www.annexia.org/forth). I also recommend Manfred von Thun's writings on Joy, even if you never plan on using stack languages. Some up-and-coming stack languages are Factor (www.factorcode.org) by Slava Pestov and Ripple (ripple.fortytwo.net) by Joshua Shinavier, a stack language designed for the Semantic Web.

Acknowledgments

Thanks to the members of the concatenative mailing list (tech.groups.yahoo.com/group/concatenative), the Cat mailing list (groups.google.com/group/catlanguage), and the Lambda-the-Ultimate.org programming language blog. In particular, I want to thank William Tanksley, Joshua Shinavier, Frank Krueger, and John Nowak.

Previous Page | 1 Introducing Cat | 2 The Type System | 3 Cat for Application Development | 4 Cat Implementation
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK