Why the Sorbet type checker is fast
blog.nelhage.com
blog.nelhage.com
Nice observation. It's a generalization of how devs with slow computers write more efficient code.
Compiling the compiler with a version the optimization added had to be at least as fast as without, so the speed improvement it provided had to outweigh both the extra code it added to the source, and the runtime complexity.
It didn't serve to make it optimize well, but it served its purpose in keeping the compiler lean and simple to understand, and ensuring fast compilation.
https://sorbet.run/talks/RubyConf2019/#/22
(I work on the Sorbet team)
>As an aside, it's amazing how much work Stripe has put into Sorbet.
In case it wasn't obvious to people reading about Sorbet for the first time.
But I think it’s important to emphasize both sides: Sorbet is not just some tool that only people at Stripe use and contribute to. It’s growing in both popularity and contributions in many places outside of Stripe.
That list is a minority of all 166 in the original (and there may still be some Stripe accounts there).
Additionally all of the top 10 are current or former Stripe employees, and at least 96% of all commits come from current or former Stripe employees.
BUT there's also nothing wrong with this – in a similar project I created (https://github.com/vimeo/psalm), 90% of the commits come from employees at Vimeo. I was just pointing out it's good.
1. You can migrate class by class or even method by method. 2. You add type support to a method by prefixing it with a special lambda (Sig) that is read at class evaluation. 3. It provides its benefits right away. But really, most value comes from network effects. You won't get type warnings if the method you're calling isnt typed, because the return type cannot then be inferred. 4. No gems are typed right now. We type out type definitions for external dependencies in *.rbi files.
It's funny that you mention typescript because in that sense the two are quite similar. Types are defined either inline or in separate files .rbi/types.d
Opinions in the company are split probably roughly ~60/40 if Sorbet is worth the effort or not with support having a smallish majority.
This is only if you can get it to run on your project. Far as I know, you can't segment it to just a few folders, can you? Our project has tens of thousands of files and even running it all night, it eventually hard crashes.
Using Rails?
What a great idea!