4 ms·
This is really interesting, thanks. As an academic working on gradual typing and dynamic checks, the sorbet experience is extremely valuable. (I've cited the th
by samth 5y ago
This is really interesting, thanks. As an academic working on gradual typing and dynamic checks, the sorbet experience is extremely valuable. (I've cited the threshold someone on your team mentioned for when the cost of checks gets too high.) So I'd love to see the blog post.
It sounds like you're taking an approach fairly similar to what Facebook is doing with Hack these days: Dynamic checks implied by types help catch bugs and can be often optimized away, and static types are hints but not trusted, but the type checker means that using the hint is almost always a good idea. Is that accurate?
- jez 5y agoYep, that's accurate. If anything, there aren't enough hints in Stripe's codebase, so much so that I'd love people to add more! When I'm looking at a production performance profile result, trying to figure out why the compiler didn't speed something up, the first thing I do is add or improve types. It has never slowed down the resulting compiled code, and usually speeds it up substantially.