Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In this video titled 'Gradual typing for Ruby: comparing RBS and RBI/Sorbet', Alexandre Terrasa, a staff engineer at Shopify, discusses the evolution and benefits of gradual typing in Ruby. The presentation focuses on comparing RBS (Ruby Signature) and RBI (Ruby Interface) with Sorbet, shedding light on type checking methodologies and their implications in programming. Key points discussed include: - **Importance of Type Checking**: Gradual typing helps to avert runtime errors by enforcing type contracts in code, especially in larger codebases. Type errors can lead to significant customer-facing issues, making it essential to catch such mistakes in advance. - **Historical Background**: The video highlights previous attempts at type checking in Ruby, including LDL in 2015 and Sorbet released by Stripe in 2019. In 2020, RBS was introduced to provide a standardized type definition language for Ruby. - **Layered Type Checking**: Terrasa explains two levels of type checking: using TypeProf for assessing applications and libraries, and RBS/Sorbet for standardized type definitions. Ruby 3 aimed to create a structured ecosystem for type checking by emphasizing a clear definition language (RBS) that could work across various tools. - **RBS vs. RBI**: RBS operates as an external domain-specific language (DSL) which is more expressive but requires additional tooling, whereas RBI is an internal DSL that aligns neatly with Ruby's syntax. Both methods support inline annotations yet differ in their integration and performance when used in larger projects. - **Developer Feedback**: At Shopify, 98% of code files transitioned to Sorbet, revealing a strong developer demand for type safety which improved their confidence in the codebase. However, there were mixed feelings about the unfamiliar syntax of RBS, particularly for seasoned Ruby developers. - **Type Safety Mechanisms**: The presentation discusses divergences in type safety between reflection methods in Steep and runtime checking in Sorbet, showing how they handle object-oriented design principles and method definitions. - **Future Opportunities**: The potential for improved inline type annotations with Ruby's core features and standardization across various type checkers were suggested as essential next steps for Ruby's gradual typing journey. In conclusion, Terrasa emphasizes that while both RBS and Sorbet offer vital features for type checking and have their distinct advantages and drawbacks, there is a growing need to establish standardized methods for typing principles within the Ruby community, especially with the increasing adoption of type checkers like RBS. Terrasa's session illustrates the dynamic advancements in Ruby's gradual typing landscape and affirms a promising collaboration pathway between RBS and Sorbet, as Ruby continues to evolve.
Suggest modifications
Cancel