We’re so excited about the new tool we have found! Sorbet was presented by Stripe team at RubyKaigi at the beginning of summer. This typesystem can be adopted gradually with different teams and projects adopting it at a different pace. It supports ‘And’ and ‘OrTypes’ as well as basic generics. Its type syntax is backwards compatible with untyped Ruby. Take a look at Ruby typechecker called Sorbet!
Ruby has a reputation for being “magic” — its loose syntax and monkey-patching functionality allows developers to rapidly build powerful applications, but it can also lead to unclear and confusing code. With Sorbet, Ruby developers may have a new opportunity to bring some stability and clarity to their projects.
Sorbet developers team intend to open source the project but haven’t had the resources to split out the Stripe-specific bits and are still focusing primarily on the internal deployment. So, we hope that someday this checker will be available for everybody.
Despite it is currently in beta, some technical details are already named:
- focus on practicality;
- the entire thing is designed with nice error messages in mind;
- local type inference, no need to declare local variables;
- non-nillable types by default;
- smart control-flow dependent typing;
- union and intersection types.
Take a look at Sorbet yourself!