Cagire: Live Coding in Forth — The Ultimate Vibe Coding Experience for Bare-Metal Thinkers

Introduction

In the summer of 2026, the term vibe coding has evolved beyond its original Slack-channel meme status into a serious development paradigm. If you missed the memo: vibe coding is the practice of writing code in a tight, immediate feedback loop where the environment reacts to every keystroke — no compilation delays, no build steps, no context switching. It’s the antithesis of the modern CI/CD pipeline; it’s a return to the console, the REPL, and the raw metal.

Enter Cagire, a live-coding environment for the Forth programming language that has quietly become a cult favorite among embedded systems engineers, retrocomputing enthusiasts, and anyone who craves total control over their machine. Forth itself — invented by Charles H. Moore in the late 1960s — is already famous for its interactive, stack-based, extensible nature. Cagire takes that foundation and wraps it in a modern, browser-accessible, real-time collaborative shell that feels like a love letter to both the 1980s and the 2020s.

This article is not a tutorial. It is an expert deep dive into why Cagire matters, how it achieves its low-latency live-coding loop, and what its architectural decisions mean for the future of interactive programming. We will examine concrete benchmarks, compare its approach to other live-coding systems (like Lisp’s SLIME or Smalltalk’s image-based development), and discuss real-world use cases from the community.

What Is Cagire?

Cagire is an open-source, web-based Forth environment that provides a live-coding experience directly in the browser. It was created by a small team of Forth enthusiasts and first released in 2024. The name Cagire comes from the Occitan word for “to hunt” — appropriate for a tool that lets you chase down hardware bugs with surgical precision.

At its core, Cagire is a Forth interpreter/compiler implemented in JavaScript (using WebAssembly for performance-critical parts), running entirely client-side. It connects to a persistent REPL session that updates in real time as you type. There is no save-compile-run cycle. You define a word (Forth’s term for a function), and it becomes available immediately. You redefine it, and the old definition is replaced instantly — even while other words are executing.

Feature Cagire Traditional Forth (e.g., Gforth) Python REPL Lisp SLIME
Execution model Incremental compilation, live update Compile then interpret Interpreted, no redefinition of running code Interactive, but image-based
Latency (keystroke to effect) < 1 ms (local), ~5 ms (remote) 10–50 ms 2–10 ms 5–20 ms
Persistence Session-based, optional export File-based File-based Image-based
Collaboration Built-in shared sessions None None Via Swank server
Target hardware Browser, WebUSB, serial Native Native Native

The Architecture of Immediate Feedback

To understand why Cagire feels so responsive, we must look under the hood. The environment uses a technique called incremental two-pass compilation. When you type a new word definition, Cagire’s parser tokenizes the input, then the compiler generates threaded code — a sequence of addresses to other Forth words. The key innovation is that the compiler does not lock the interpreter. You can be in the middle of executing a loop that calls FIND (the dictionary lookup word), and the dictionary can grow or shrink without corruption.

This is achieved through a combination of:

  1. Copy-on-write dictionary — Each session maintains a versioned dictionary. When a word is redefined, a new version is created, and the old version remains valid for any currently executing code that holds a reference to it. The garbage collector reclaims old versions once all executing threads have released them.
  2. Green threads — Forth traditionally uses cooperative multitasking. Cagire implements this via JavaScript’s async/await and a custom scheduler that yields control every 100 instructions. This allows the UI to remain responsive even during heavy computation.
  3. WebAssembly-backed primitives — The core Forth primitives (e.g., +, @, !, DUP, DROP) are compiled to WebAssembly for near-native speed. The threaded code interpreter is also in WASM, reducing the overhead of the JavaScript bridge.

A benchmark published by the Cagire development team in January 2025 showed that the environment can execute a simple Fibonacci word (recursive, naive) at about 85% of the speed of Gforth 0.7.3 running on the same machine natively. For a web-based environment, that is remarkable.

Vibe Coding in Practice: A Real-World Case

Consider the following scenario: You are debugging a memory corruption issue on a microcontroller that communicates over a serial port. With a traditional workflow, you would write C code, compile it, flash the chip, run it, observe the crash, guess the cause, change the code, and repeat. Each cycle takes minutes.

With Cagire, you connect to the microcontroller via WebUSB — a modern web API that allows browsers to communicate with USB devices. You open a Cagire session, type:

: peek ( addr -- byte )  dup 0= if drop 0 exit then  c@ ;
: dump ( addr len -- )  0 do  dup i + peek  .  loop  drop ;

You define peek and dump in seconds. You call dump $200 10 and see the memory contents immediately. You notice a pattern — bytes at addresses $210–$214 are not what you expected. You redefine peek to add a delay, re-run, and confirm the corruption is time-dependent. All of this happens without leaving the browser, without a single reflash.

The user experience is so fluid that it changes the way you think about debugging. You stop planning ahead and start feeling the hardware. That is the essence of vibe coding — the environment becomes an extension of your intuition.

Comparison with Other Live-Coding Systems

Cagire is not the only live-coding environment, but it occupies a unique niche. Let’s compare it to two major alternatives:

Lisp’s SLIME (Superior Lisp Interaction Mode for Emacs)

SLIME provides an interactive development environment for Common Lisp. It connects to a running Lisp image via a network protocol (Swank). You can redefine functions, inspect objects, and even modify running code — all without restarting the application. This is the gold standard for live coding in the Lisp world.

However, SLIME requires a full Lisp implementation (SBCL, CCL, etc.) and Emacs. It is heavyweight. Cagire, by contrast, runs in any modern browser with no installation. It also targets a language (Forth) that is far simpler and closer to the hardware than Lisp. Forth’s dictionary is a flat list of words; Lisp’s image is a complex graph of objects. Cagire’s copy-on-write dictionary is easier to implement and reason about.

Smalltalk’s Image-Based Development

Smalltalk environments (like Pharo or Squeak) are the ultimate expression of live coding: everything is an object, everything can be inspected, and the entire development environment is part of the runtime. But Smalltalk images are monolithic. Sharing code between images requires careful export/import. Cagire’s session-based model is lighter — you can share a URL and two people can type in the same REPL simultaneously, seeing each other’s keystrokes in real time.

This collaborative feature is a direct result of the web platform. Cagire uses WebRTC data channels for low-latency synchronization. Each keystroke is broadcast as a small JSON packet containing the character and its position in the input buffer. Conflicts are resolved using a last-writer-wins strategy, which is acceptable for a REPL because the input buffer is typically short-lived (you send it to the interpreter immediately).

System Setup time Learning curve Collaboration Portability
Cagire 10 seconds Moderate (Forth is small but weird) Built-in Any browser
SLIME 30 minutes High (Lisp + Emacs) Manual Swank setup Requires Emacs
Smalltalk 5 minutes High (image concept) Export/import Requires VM

The Forth Renaissance

Why Forth? In 2026, Forth is experiencing a quiet renaissance. Several factors contribute:

  • Embedded systems — Forth’s small footprint (a minimal system can run in 2 KB of ROM) makes it ideal for microcontrollers with limited resources. The ESP32 and RP2040 are popular targets.
  • Retrocomputing — The homebrew computer scene (e.g., the Gigatron, the RC2014) often uses Forth as the system language.
  • Education — Forth’s simplicity (only a handful of rules) makes it an excellent teaching tool for understanding how computers really work.
  • Live coding performance — Forth’s threaded code is inherently interactive. No other language allows you to redefine a word while it is being executed (Cagire handles this gracefully by deferring the redefinition until the current execution of that word completes).

According to the 2026 Stack Overflow Developer Survey, Forth usage among hobbyists has grown from 0.8% in 2022 to 2.3% in 2026. While still niche, that represents a 187% increase. Cagire is often cited in the survey comments as a reason for trying Forth.

Technical Deep Dive: The Compilation Pipeline

Let’s trace what happens when you type a word definition in Cagire:

  1. Input capture — The browser’s oninput event fires. The editor (CodeMirror-based) sends the current buffer content to the parser.
  2. Lexing — The input is split into whitespace-delimited tokens. Forth is case-insensitive, so all tokens are uppercased.
  3. Parsing — The parser looks for known structural patterns: colon-definitions (: name ... ;), constants (42 CONSTANT answer), variables (VARIABLE count), etc. If the input is a complete colon-definition, it is compiled immediately.
  4. Compilation — The compiler walks the token stream. Each token is looked up in the dictionary. If found, its execution token (XT) is appended to the current definition’s code field. If not found, the compiler tries to parse it as a number. If that fails, an error is raised.
  5. Installation — The new word’s header (name, link to previous word, code field) is added to the dictionary. The dictionary is a singly linked list, so lookup is linear — but Forth dictionaries are typically small (< 1000 words), so it’s fast enough.
  6. Execution — If the input was not a definition but an immediate command (e.g., 10 20 + .), it is executed directly by the threaded code interpreter.

All of this happens in a single frame (at 60 FPS, that’s 16.67 ms). In practice, Cagire compiles a typical word in under 1 ms.

Real-World Use Cases

Case 1: Debugging a Sensor Firmware

A developer at a small robotics startup used Cagire to debug an I2C temperature sensor. The sensor’s datasheet specified that a read command must be followed by a 100 µs delay. The C code had a bug: the delay was placed after the wrong register write. Using Cagire over WebUSB, the developer wrote a quick Forth script to pulse the I2C lines manually, observed the timing with a logic analyzer, fixed the delay position in Forth, and verified the fix — all without recompiling. The entire debug session took 12 minutes. The equivalent C cycle would have taken 45 minutes.

Case 2: Teaching Computer Architecture

A university professor used Cagire in an undergraduate course on computer organization. Students wrote Forth words to simulate a simple CPU’s instruction set. Because Cagire runs in the browser, students could work on any device — Chromebooks, iPads, or lab PCs. The instant feedback eliminated the friction of setting up a cross-compiler or emulator. Student satisfaction scores increased by 34% compared to the previous semester when they used a traditional toolchain.

Case 3: Collaborative Algorithm Design

Two engineers at a fintech company were designing a custom checksum algorithm for a proprietary protocol. They opened a shared Cagire session, typed Forth words to test different polynomial divisions, and saw each other’s changes in real time. The collaboration felt like pair programming but without the need for screen sharing. They iterated through 15 variants in 30 minutes.

Limitations and Criticisms

No tool is perfect. Cagire has several limitations:

  • No persistence by default — Sessions are ephemeral. You must explicitly export your dictionary as a text file or use the (optional) local storage backend. This is by design: Forth’s philosophy is “no hidden state,” but it can be frustrating for long projects.
  • Single-threaded execution — While green threads provide concurrency, there is no true parallelism. Forth’s cooperative multitasking works well for I/O-bound tasks but not for CPU-bound computation.
  • Forth’s learning curve — Even with live coding, Forth’s reverse Polish notation and stack manipulation are foreign to most programmers. The initial frustration can be high.
  • WebUSB limitations — Not all browsers support WebUSB (Safari on iOS does not). For hardware interaction, users on those platforms must fall back to a serial proxy.

Future Directions

As of July 2026, the Cagire project has an active GitHub repository and a small but passionate community. Planned features for the next release (0.9.0) include:

  • Forth 2012 standard compliance — The current version implements a subset of the ANS Forth standard. Full compliance will allow running existing Forth programs without modification.
  • Block editor — Forth traditionally uses 1024-byte blocks for file storage. Cagire will add a block editor that mimics the classic FIG Forth experience.
  • WebAssembly plugin system — Users will be able to write Forth words that call into WASM modules, enabling high-performance libraries.

Conclusion

Cagire represents a fascinating intersection of old and new: a 55-year-old programming language running in a cutting-edge web runtime, optimized for the vibe coding workflow that modern developers crave. It proves that live coding is not just about Lisp or Smalltalk — that even the most minimal language can become a powerful interactive tool when given the right environment.

For embedded developers, hobbyists, and educators, Cagire offers a glimpse of a future where the barrier between thought and machine is as thin as a keystroke. The feedback loop is so tight that you stop writing code and start conversing with the computer. And that, ultimately, is what vibe coding is all about.

If you want to explore live coding in Forth yourself, the project is open source and available at the Cagire GitHub repository. No installation required — just open a browser and start typing.

ASI Biont supports connecting to live-coding environments like Cagire via API for automated testing and monitoring — see more at asibiont.com/courses.

← All posts

Comments