Type Checking Ruby
summary
A library called rdl adds types to Ruby by treating type annotations as runtime method calls and doing static type checking at runtime, so checks run after metaprogramming executes. It implements unions, intersections/overloads, generics, tuples, singleton/self types and runtime contracts (wrap) and exposes a CLI and gem on GitHub. It even handles Rails metaprogramming like belongs_to by emitting types when methods are generated. Implementation works for real code but Rails support is still sketchy and runtime wrapping costs remain a tradeoff.
AI-written summary · about
chapters (10)
- 0:00Introduction to RDL
- 1:24RDL demonstration
- 5:58Benefits of typing
- 9:18Ruby-specific typing
- 12:32Advanced typing features
- 15:39Generics and containers
- 20:40Metaprogramming challenge
- 24:54The RDL solution
- 30:05Design trade-offs
- 36:57Q&A and closing
related talks
37mTypes and Ruby Programming Language
37mChecking Your Types: An Overview of Ruby's Type System
53mAn introduction to typed Ruby programming
32mThe State of Ruby 3 Typing
39mType Checking Ruby Programs with Annotations
36mAn introduction to typed Ruby programming
25mA Dangerous Game: Safety in Ruby
31mKnow Your Types - Bringing Static Types to Dynamic Languages
