Ricochet: The Stack is Back

A pure-postfix, stack-based programming language with dynamic class-based OOP, source-mapped bytecode metadata, and capability-first side effects. Built for the modern stack.

100%
Postfix — No Infix Parser
2
VM Stacks — Compile & Runtime
Rust
Bytecode VM
v1
Web MVC Built-in

Run Snippets Live

Write postfix Ricochet code in your browser. Watch the data stack shift, push, and pop in real-time as your code compiles and executes.

main.rco
Load Template:
Instruction Trace (IP)
Code trace will appear here
VM Status: Ready

Why Ricochet?

Preserving postfix stack thinking while building modern, PostgreSQL-backed MVC web apps and robust CLI tooling.

Pure Postfix Execution

No infix parser. No operator precedence. Every operator is a word, every word is a stack operation. Data flows left to right, always.

🏗️

Class-Based OOP

Open classes, dynamic creation, and runtime metaprogramming — without turning the language into Java with Forth punctuation. Postfix declarations: name first, keyword second.

🔍

Stack-Aware Debugger

Breakpoints, break-on-fault, task inspection, and full stack traces with source maps. Debug running requests, spawned tasks, and async work from the terminal.

🛡️

Capability-Oriented

No magical global IO. Apps, tests, plugins, and hosted scripts receive explicit powers through context injection. Request, db, logger, view — all capability objects.

🌐

Web MVC Built In

Routes, controllers, PostgreSQL Active Record, and HTML templates with full Ricochet interpolation. rco serve --watch with hot reload and stable request snapshots.

📦

Batteries Included

Single CLI for everything you need. Project scaffolding, dependency management via ricochet.toml, test suites, and compile-time documentation generation.

Write Postfix OOP Code

Object-oriented programming in postfix is clean and readable. Let's see the structure.

Subclassing & Variable Access

In Ricochet, class declarations use the postfix structure Name Parent Subclass. We end definitions and blocks using the universal word end.

Comments are enclosed in double parentheses (( ... )). Comments immediately preceding declarations compile as their docstring documentation.

Variables are declared with postfix var (for example, amount var or 100 amount var), written with set, and read with $name or dynamic get. Generated accessors stay postfix: user email.get reads a field, and "a@example.com" user email.set sets it.

Method calls keep the receiver before the selector, such as user displayName. In methods, the receiver is available as self.

user.rco
(( Represents a user account ))
User Model Subclass
  "email" Accessor
  "name" Accessor

  [
    self name.get nil? if
      self email.get
    else
      self name.get
    end
  ] "displayName" Method
end

User new user var
"Alice" $user name.set user set
$user displayName println

(( Output terminal: Alice ))

Get Ricochet

Ricochet is distributed as precompiled native package executables for Windows, Linux, and macOS. Visit our GitHub releases to download the latest setup installer or portable binaries.

Download Executable Packages View Source on GitHub