I looked into Ruby's static typing attempts but the picture painted was grim.
I looked into Ruby's static typing attempts but the picture painted was grim.
The attempts you've seen is probably Sorbet (sorbet-runtime) and RBS. In my opinion, RBS would be an option for me if they didn't force me to work in a separate file just for type declarations.
There is one gem that is interesting, it reminds me a lot of jsdoc. It's called rbs-inline https://rubygems.org/gems/rbs-inline
I think the problem with static typing is that it changes the whole ecosystem too much to be considered just optional, even if it's backwards compatible (like in Python).
Just as an example I'm using lambdas in fasthtml in Python that don't allow type specifications for adding routes and fasthtml keeps on spitting out warnings that I didn't specify the type and doesn't handle variables in lambda functions correctly.
That's a very interesting yet valid downside I didn't think of
I definitely think Rails can be worth trying, but if you're the type to be evaluating types from the outset, I'd wager that's the exact kind of person that won't like what they get into.