Ruby has literally always had types
summary
Claims that Ruby always has types and shows a concrete runtime type system: the literal gem provides composable types (union, intersection, deferred recursive JSON), literal.struct/data props, enums, value/decorator wrappers, and plans for typed collection objects and cross‑property validation. Example: a nil email bug at Shopify causes a ZenDesk deletion of ~4–10k tickets, motivating runtime checks that raise (production checks stay enabled and cut errors at ClearScope). Types use the triple equals interface, generate initializer code to avoid runtime allocation, and interoperate with metaprogramming.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 1:35Ruby's relationship with types
- 3:22Real-world bug from missing types
- 4:27Static typing attempts in Ruby
- 8:00What is a type?
- 9:23Ruby's triple equals as types
- 12:57Creating custom types
- 14:42Introducing Literal library
- 17:58Why types are useful
- 19:01Literal Data and Struct
- 23:14Literal Properties
- 25:00Literal Enums
- 27:47Literal Values and Decorators
- 29:12Performance considerations
- 32:02Collection objects
- 34:07Accordion of complexity
- 35:31Type variance in collections
- 37:20Cross-property validation
- 38:24Result objects and future plans
- 39:28Summary and benefits
- 44:50Q&A begins
