DEV Community

Andrew Betts for Fastly

Posted on

Ruby, meet Compute@Edge! Building on Fastly with Yuta Saito

At RubyKaigi in September, Yuta Saito presented a remarkable new project allowing Ruby to be compiled to WebAssembly, and to run on Fastly's Compute@Edge platform! I was in Japan for vacation recently and had a coffee with Yuta to talk about the project.

Ruby was designed to run on servers, and as an interpreted language without the ability to produce portable binaries, it's a rare choice for writing client-side software.

WebAssembly (Wasm) is a binary format for programs written in any language, designed to eventually run everywhere without changes. Initially intended for Web browsers, Wasm is now used beyond the Web, and Fastly has put it at the core of our edge computing platform. That means you can use any language that compiles to WebAssembly equally well on Compute@Edge, and we already have official support for Rust, JavaScript and Go.

The Ruby community have been laying the groundwork for WebAssembly support for some time, and projects like Yuta's community SDK for Ruby on Fastly Compute@Edge help to give developers more options and increase the value of WebAssembly support.

Here's Yuta's presentation. Read on for our Q&A!

Ruby meets WebAssembly - Speaker Deck

RubyKaigi 2022 Keynote


What makes Ruby a good choice for Compute@Edge?

It's flexible and dynamic. It depends on what kind of application you're writing and what the demands of it are but I feel like use cases for edge computing today tend to be small, lightweight units of code, creating simple apps at the edge to support more complex code at origin, so something that enables quick, tactical coding is valuable.

Ruby has been a hobby for a long time. It was actually developed in Japan so it's popular here. I also love WebAssembly and noticed that there's no Wasm support in Ruby. It's a shame because I think Ruby has a lot to offer in an edge environment.

How does Compute@Edge differ from other edge compute platforms?

It's all about the native support for Wasm. Compute@Edge doesn't have a 'primary' language, which is really nice, as a community that loves a specific language we don't feel like we're running under emulation as a second class citizen.

I also like Fastly as a company, you're contributing a lot to the open source community!

[Andrew] In fact we recently relaunched our open source and community support program, Fast Forward.

What use cases most appeal to you when you consider using edge computing?

It's an ideal place to do request filtering, A/B testing, redirects.

What advice do you have for developers just starting out? How is that different from the advice you'd give yourself when you started out?

As soon as you're comfortable to do it, dig down layers of the stack. Understanding the principles underlying the tools and technologies you use every day definitely help to give a lot of useful context.

I started as an iOS application engineer, and was working with an unstable compiler - but it was open source, so I just started to try and help out with some of the issues.

I started a workshop and study group with some friends, and gradually become more interested in compiler technologies.

Yuta (left) and me in Tokyo, November 2022

Yuta (left) and me in Tokyo, November 2022. I made notes from our conversation, so the words above are written by me but approved by Yuta.

Top comments (0)