Boink
General
Toys
Other
Blog Archives
Super Links
Copyleft

Unless otherwise stated, all original content on this site is licensed under your choice of the GNU FDL or the Creative Commons ShareAlike License.

GNU FDL Creative Commons License

Validate

Hopefully, this website is valid. You can check the XHTML, the CSS, and the RSS.

Valid XHTML 1.0 Strict Valid CSS Valid RSS

Stats

A tiny toy language

One day when I was supposed to be studying for a test I wrote this little interpretor for a minimalist language I made up. The language is so simple the interpretor is only 33 lines of perl. I named it ‘rat’ because that was the first thing to pop into my head and naming this thing didn't merit any more thought. You can try it out by getting this program which implements Euclid's algorithm for the gcd and this this one that uses it. Run it like so:

cat test.rat | perl rat

It ought to be more or less Turing complete, but it's pretty useless since the interpretor doesn't let you do much more than print out results as numbers. Also, trying to express an algorithm in this language is monstrously awkward.