Are you interested in lightweight web development on the edge? Platforms like Cloudflare Workers and Fastly Compute have been gaining tremendous popularity.
However, edge development in Ruby still faces significant challenges. One of the biggest issues, I believe, is file size. ruby.wasm is an incredible piece of work, but since it packs a fully-featured Ruby into Wasm, the generated artifact is simply too large for edge use cases.
Do you really need that much overhead just to do "a little something"?
My new framework, Uzumibi (a Japanese name, like "Hono" — it means live embers buried under ash), breaks through that wall.
Here's a very basic example of Uzumibi code:
class App < Uzumibi::Router
get "/" do |req, res|
res.status_code = 200
res.headers = {
"content-type" => "text/plain",
"x-powered-by" => "#{RUBY_ENGINE} #{RUBY_VERSION}"
}
res.body = "It works!\n"
res
end
end
$APP = App.new
The Evolution of mruby/edge
Let me give you a bit of background. At RubyKaigi 2024, I gave a talk about mruby/edge, a lightweight, Wasm-friendly implementation of mruby written in Rust.
At the time, it was barely more than an implementation that could run a Fibonacci function — calling it a PoC would have been generous. The idea of running a Wasm file based on mruby/edge on the edge felt like a pipe dream.
Two years later, mruby/edge has evolved dramatically. It now covers over 80% of the instructions implemented by the mruby 3.4 VM. We prioritized the most critical instructions and got them working. We've also completed standard library implementations, using mruby/c 3.x as a benchmark, focusing on the most "Ruby-like" features. Documentation is available in COVERAGE.md on the mruby/edge repository.
And of course, it still runs easily in the browser, so we've already prepared a Playground for you. Please give it a try!
(The Playground uses mruby-compiler2, created by my dear and respected friend hasumikin. mruby/edge doesn't have its own compiler yet.)
The time has finally come. I've released Uzumibi, a framework built on mruby/edge, and I'm actively developing it.
The Firepower of Uzumibi
Here are the key features of Uzumibi:
- Lightweight artifacts. A Cloudflare Workers app with realistic functionality weighs in at around 1.2 MiB, and compresses to under 400 KiB. That's well within the free tier limits, and loads fast.
- An intuitive, Sinatra-like routing DSL that feels natural for Ruby developers.
- Multiple project templates. Currently supported: Cloudflare Workers, Fastly Compute, Fermyon Cloud (Spin), and as a bonus, Google Cloud Run(!). Let me know what other platforms you'd like to see supported.
- You can develop APIs entirely in the browser. This is powered by Web (Service) Workers.
Note: Complex features like external service integrations currently only work on Cloudflare Workers. Sorry about that!
With Uzumibi, you can deploy an application to the edge just by writing Ruby code (okay, you might need a little bit of configuration and some dashboard clicks). Uzumibi is a framework for stubborn Ruby developers (like me!) who find JavaScript and TypeScript just a little bit... not quite right.
Uzumibi is brand new — there will be missing features and bugs. But that also means the possibilities are wide open. Come to RubyKaigi and hear about the potential of this newborn "new Ruby."
See You in Hakodate!
My talk is scheduled at RubyKaigi 2026 in Hakodate, Hokkaido. Check the official schedule for the exact date and time:
I'm going to have a talk on April 23, the 2nd day of RubyKaigi!
Can't wait? Great news for those who want to try it right away — I've published "Beginning Uzumibi" online. Give it a spin, and then come tell me your thoughts in person at Hakodate!
(Online issues and pull requests are, of course, also very welcome!)
Top comments (0)