The journey to the perfect type signature in Ruby
31-Oct-2025 575
I think runtime type checking is the most pragmatic approach to typing Ruby and in many ways it’s superior to static type checking. I’ll write more about that another day.
Literal helps you add runtime type checking at object boundaries. Its prop method generates the initialiser and optional reader/writer methods.
For a while now I’ve wanted to extend Literal with type signatures and I’ve recently made progress on this.
So today, I want to explore this design problem. How do you add types to a language that wasn’t designed with types in mind? And how do you make it feel native?
Let’s begin by looking at some other examples:.
The journey to the perfect type signature in Ruby #ruby #rubydeveloper #rubyonrails #journey #perfect #signature #type https://www.rubyonrails.ba/link/the-journey-to-the-perfect-type-signature-in-ruby