Introducing Wubular: Rubular Reimagined in Ruby+WASM

Ever wished a Ruby app could run entirely in your browser, without ever calling back to a server? That’s what sparked Wubular — a Rubular remake, powered by Ruby compiled to WebAssembly running natively in the browser.

If you’ve been around Ruby, you probably know Rubular — the de-facto standard tool created by Michael Lovitt (@lovitt) back in 2007 for quickly composing and testing Ruby regular expressions. I’ve relied on it countless times, but the app itself now feels a bit outdated — for example, the footer shows it’s still running on an old Ruby. On top of that, Rubular isn’t open source (at least I haven’t been able to find any code published), so the only way I thought I might help was by reaching out to the original author and offering some community support.

Original Rubular webapp
Original Rubular website preview.

But then it hit me: why not just run it directly in the browser? Since Ruby 3.2, the language has had native WebAssembly support. That doesn’t just make Rubular-style apps possible entirely client-side — it opens up wild ideas like switching Ruby versions right in the browser. (And really — can you imagine the nightmare of juggling multi-Ruby deployments on a server?) With WebAssembly, there are no server round-trips, no JS framework sprawl — just Ruby, running natively in your browser.


Rubular’s classic architecture

Rubular was a brilliant little invention: just a regex box, a test string box, and instant feedback. Behind the curtain, though, it’s a traditional server–client setup.

The frontend is plain HTML + JavaScript. Each time you type, the JS serializes the form and fires off a POST request to the backend:

POST /regex/do_test?message_id=123
Content-Type: application/x-www-form-urlencoded

utf8=✓&regex=ss&options=&test=ss&word_wrap=1&_=...

The Ruby server evaluates the regex and responds with an HTML snippet:

Rubular.handleParseResult({
  "message_id": 1,
  "error_message": null,
  "retry": null,
  "html": "<div class='match_result'>…</div>"
});

The browser then updates the results in place. Classic Ajax magic — spinners, retries, even a “permalink” endpoint.

It worked great in its day, but it comes with obvious costs:


Ruby in the Browser

Now enter WebAssembly (WASM).

Since Ruby 3.2, MRI itself can be compiled — thanks to Yuta Saito (@kateinoigakukun) — to run in WASM environments. WASM is essentially assembly for the web: safe, fast, portable bytecode that browsers (and other runtimes) can execute. Combine it with WASI (WebAssembly System Interface) and you get access to basic system features like files, time, and randomness — enough to run full Ruby apps.

That flips the old Rubular model upside down: regex evaluation (and any Ruby code) can now run entirely client-side.

It’s still the same Ruby you know — now just living inside a browser tab.


Meet Wubular

Wubular is a Rubular clone that runs 100% in your browser.

For users, it feels the same: paste a regexp, pick options, type a test string, and see results instantly. But under the hood, everything changed:

There aren’t polished Ruby-in-the-browser frameworks yet, but Ruby doesn’t need to reinvent the wheel. Using the built-in js library (require "js"), Ruby can talk to native browser APIs like document.querySelector or addEventListener.

It really is this simple, just try it:

Or, a slightly richer one: a regex input, a text input, and a checkbox that updates live:

That’s exactly how the first Wubular prototype came to life.


Ruby, WASM, and the Future of Browser Apps

Wubular is already live and usable — paste a regex, type your string, and see results instantly. But it’s also an experiment in what Ruby + WASM makes possible.

And here’s the kicker: Wubular isn’t just a quick prototype — it’s also a fully tested app, developed with TDD. Like any serious Ruby project, it ships with an automated test suite. The difference? It also runs directly in your browser, using the same tools you’d use locally. In Wubular’s case, that’s good old Minitest. Open the DevTools console in your browser, append ?run_tests to the URL, and watch the results fly by. Full integration test runs complete in milliseconds. Imagine if client-side apps booted only after passing their own test suite locally.

PRO TIP: You can combine various Ruby versions with run_tests parameter like ?ruby=3.2&run_tests.

Wubular test suite running in the browser
Wubular’s test suite running directly in the browser with Minitest.

This is the first post in the Wubular series. In the next one, I’ll dig into the internals: how Wubular mounts Ruby components in the DOM, how test-driven development feels when everything runs in the browser, and why the speed feels almost unreal.

In the meantime, go explore: the source is right there in DevTools → Network, or up on GitHub. Have fun, try to run the tests, and imagine what else Ruby in the browser might unlock.

Wubular source code including tests in DevTools.
Wubular source code including tests in DevTools.

Stay connected! Mastodon, Bluesky or Twitter/X.


Back to writings list.