DEV Community

Cover image for 🐈Cat — A Typed Concatenative Language Inspired by Joy
Pʀᴀɴᴀᴠ
Pʀᴀɴᴀᴠ

Posted on

🐈Cat — A Typed Concatenative Language Inspired by Joy

What is Cat?

Cat is a statically typed concatenative programming language that builds on the concepts introduced by Joy. Like Joy, Cat uses stack-based execution and point-free function composition instead of variables or explicit argument passing. However, where Joy is dynamically typed, Cat introduces a static type system designed to make concatenative programming safer and more predictable.

Cat was created to explore whether functional stack-based languages could be both expressive and type-safe while preserving a minimal syntax.


Specs

Language Type: Typed concatenative functional language

Released: Mid-2000s academic era

Creator: Christopher Diggins

Paradigm: Point-free programming with stack semantics

Execution Model: Functions transform stack states

Typing: Static type inference with polymorphism


Example Code (Hello World)

"Hello, Cat!" print
Enter fullscreen mode Exit fullscreen mode

A more meaningful example demonstrating stack operations:

3 4 + println
Enter fullscreen mode Exit fullscreen mode

This pushes 3, then 4, adds them, and prints 7.


How It Works

Cat programs are evaluated by composing stack transformations. Every expression is a function that consumes values from the stack and produces new ones. Instead of writing add(3,4), Cat treats the program 3 4 + as a function:

Top comments (0)