Nithin Bekal Photos About

Minimal Sorbet with inline RBS comments

01 Feb 2026

I’ve been working through the fantastic Crafting Interpreters book, and implementing the Lox interpreter in Ruby. I wanted a minimal type checking setup for the code, so I decided to configure sorbet with RBS comment syntax.

First, we add the sorbet and tapioca gems to the Gemfile.

gem "sorbet"
gem "tapioca", require: false

Next, we add a sorbet/config file that includes all the arguments that we would pass when running the srb typecheck command:

--dir
lib
--enable-experimental-rbs-comments

And that’s basically it! You can now type check your Ruby codebase with bundle exec srb typecheck.

Based on my experience adding Sorbet to a Rails app in the past, I expected this to be more cumbersome. Having seen how straightforward it is to get started, I think sorbet is going to be part of even my smaller Ruby projects.

Hi, I’m Nithin! This is my blog about programming. Ruby is my programming language of choice and the topic of most of my articles here, but I occasionally also write about Elixir, and sometimes about the books I read. You can use the atom feed if you wish to subscribe to this blog or follow me on Mastodon.