4 ms·
Any reason why existing typecheckers for Ruby didn't make the cut? There are projects like RDL [1] which provide similar functionality. I know for certain that
by sankha93 8y ago
Any reason why existing typecheckers for Ruby didn't make the cut? There are projects like RDL [1] which provide similar functionality. I know for certain that people from Stripe were taking a look at it last year from the issues they had raised.
Disclosure: I am a grad student, recently started working on RDL.
[1]: https://github.com/plum-umd/rdl https://github.com/plum-umd/rdl
- hendzen 8y agoI'm sure they will come up with some plausible reason like the project having incompatible goals, or embracing a different design architecture than the one they wanted. Truthfully, these 'prestige' projects are done for reasons other than actually improving the development standards. They probably didn't use RDL because it was more fun to write their own then figure out someone else's thing. For all we know they may not have even had a real need for a new typechecker. Stripe could have a valued engineer who seemed bored so engineering management gave him or her an intellectualy interesting project to do - even if it wasn't that important to the business.
- exolymph 8y agoSure, that's possible, but we don't really have enough information to say either way.
- ksec 8y agoI think they mentioned they will present more information in an up coming conference. And it makes this TypeChecker possibly the most battle tested solution out of all the competing ones.
- mattbessey 8y agoIt would seem your cynicism was unfounded https://news.ycombinator.com/item?id=17226332 https://news.ycombinator.com/item?id=17226332
- chrisseaton 8y agoWhat's the next step for RDL? It seems like Hummingbird is much more powerful than Sorbet, but it's hard to tell without them publishing a paper yet.
- sankha93 8y agoThere are a bunch of interesting stuff coming along. I don't know if you have seen the Refinement types in Ruby paper based on RDL recently published in VMCAI [1], this opens the window to verification of Ruby code. [1]: https://arxiv.org/abs/1711.09281 https://arxiv.org/abs/1711.09281
- chrisseaton 8y agoThanks I added that to rubybib.org - please encourage your colleagues to create PRs when they publish papers so the whole community can find Ruby research more easily.
- klmr 8y agoSorbet appears to be a language extension rather than a library, similar to TypeScript or Flow in the JavaScript ecosystem. I’m guessing that one of their goals was ease of use for type annotations. I’ve had a quick look at RDL and while I quite like its syntax it is somewhat more cumbersome than having type annotations “inline”, as it were. Furthermore, the annotations in RDL are themselves stringly typed, which comes with its own issues.
- ptarjan 8y agoHi and thank you for working on RDL! We do love the project and spoke with Jeff Foster a few times last year. We did use your standard library annotations for Sorbet and have many fixes to them sitting in your pull request queue: https://github.com/plum-umd/rdl/pull/68 https://github.com/plum-umd/rdl/pull/68 https://github.com/plum-umd/rdl/pull/72 https://github.com/plum-umd/rdl/pull/72 https://github.com/plum-umd/rdl/pull/57 https://github.com/plum-umd/rdl/pull/57 . We stopped submitting more since these weren't being upstreamed. Before we started our project, I evaluated rolling out RDL instead of building our own typechecker. Trust me, I would MUCH rather use an existing project than have to build our own, but sadly it just didn't scale to our millions of lines of code. I'm more than happy to chat about the details of why we didn't use RDL if you'd like to email me at sorbet@stripe.com. Thanks again for your great project, we're standing on the shoulders of giants.
- nextos 8y agoYou are embarking onto a very interesting, but tough project due to the extremely dynamic nature of Ruby! Have you considered the property-based QuickCheck approach? Instead of building a type checker, you just annotate your code with properties (preconditions, postconditions and class invariants). You can generate tests to verify your code and also inject runtime checks to fail early in case of violations. In my experience, this tends to work much better on dynamic languages and it also scales to larger codebases with heavy usage of dynamic idioms.
- sankha93 8y agoOh, I am not sure how these went unmerged! We should do something about the PRs. Will shoot you an email to discuss more.
- tonyhb 8y agoQuick plug for RDL. It's pretty great. There are a couple issues with Rails, but for standard Ruby code and modules it's a much better process to read, write, and maintain code with RDL than without