Schedule

Vinicius Stock
Vinicius Stock
  • @vinistock

Vinicius Stock is a Staff developer working on the Ruby DX team at Shopify. Creator of the Ruby LSP, Vini started by writing Rails applications in 2015 and is now dedicated full time to improving developer tools, language servers, gradual typing and debuggers for Ruby.

Embracing Ruby magic: Statically analyzing DSLs

One of Ruby’s most powerful features is the ability to extend the language itself through meta-programming. We can create rich and elegant DSLs that allow developers to solve problems with flexible and concise code.

The drawback of DSLs is that they are difficult to analyze statically, reducing the usefulness of developer tooling like editor integrations. Since each gem can define their own DSL, we cannot account for all possible DSLs that may exist in a given application. So what can we do?

Let’s do a deep dive into the Ruby LSP’s add-on API, which allows any other gem to enhance the static analysis understanding of the language server for a more accurate editor experience. We’ll explore the techniques behind it and which class of problems it can solve.