Gradual Typing in Ruby - A Three Year Retrospective, by Ufuk Kayserilioglu

Abstract

We began adopting gradual typing on Shopify's giant monolith almost 3 years ago. Today, we are running the monolith with great type coverage and even see some internal teams commit to stricter typing in their components.

The road to get here was not easy, though. We had to work with our developers to solve the right problems at the right levels of abstraction to ensure the adoption was healthy. This talk will go over some of the challenges and some of our wins along the way. It will also help you decide if gradual typing might work for your codebase and your team, as well.

Details

The intended audience are Ruby developers that work on sizable codebases and inside small to large teams.

The talk will be a retrospective of how Shopify navigated the technical and human aspects of gradual typing adoption with success. The expected outcome for listeners is to be able to use the same tools and strategies on their codebases and with their teams.

A rough outline of the talk looks like this:

  • Why gradual typing?
    • Ruby is dynamically typed
    • But static analysis is a powerful tool
    • Gradual typing is the best middle-ground
  • What are the technical challenges of gradual typing Ruby?
    • Ruby is a very dynamic language, that's why we love it
    • Our dependencies have no static artifacts
    • We have a lot of dynamic methods defined at runtime, which have no static artifacts
    • Runtime type-checking improves checks but has a performance implication
  • What are the human challenges of gradual typing Ruby?
    • People love Ruby because it is dynamicly typed.
    • Are we turning Ruby into Java?
    • How can we make it easy for teams to get started?
    • What benefits do teams get out of gradual typing?
    • How can we advertise those benefits?
  • How the Ruby Types team at Shopify met those challenges?
    • We built a lot of tooling to make gradual typing easier.
    • We started collecting data as early as possible
    • We built dashboard to see if we were moving in the right direction
    • We talked to our customers (internal developers) early and often to understand pain points.
    • We interviewed teams to understand their experience of working with types
    • We built small experiments to validate some of our hypotheses.
    • We were always ready to help developers who were having problems.
    • We were active in the community and contributed to the projects that mattered to us to ensure that they worked well for our developers.
  • What are some of our learnings from our 3 year experience?
    • Build - Measure - Learn loops really work to direct your efforts to the right places
    • Treating internal developers as customers and your team's output as a product is important
    • Building the right tooling that is easy to use and hard to misuse is a great accelerator
    • Sharing your learnings through open-source and public engagements makes the experience better for everyone.
    • A gentle ramp up of adoption is crucial. Until more developers can see the benefits, do not get in the way of developers.

Pitch

The proposed speaker is the lead of the Ruby Types team at Shopify and has been working on the company's gradual typing adoption almost since the beginning.

In that position, the proposed speaker has first-hand experience of the challenges and benefits of gradual typing in Ruby and was instrumental in setting the direction of the project in general. Moreover, he is also the co-author of many of the tools created and developed inside the company throughout the journey.

Edit proposal

Submissions

RubyConf 2021 - Accepted [Edit]

Add submission