Hacker News new | past | comments | ask | show | jobs | submit login

How does this compare to the sorbet project? Is it two different implementations for the same goal or is it adding support in ruby so sorbet can also benefit?



The sorbet project has an FAQ about that (I was curious too):

https://sorbet.org/docs/faq search for “RBS” (on mobile, no deep links)



AFAIU sorbet can consume RBS files, and probably produce them from libraries that use it.

But other type checkers could be implemented relying on the same information.


That's correct. Sorbet currently uses RBI but after meeting with core they standardized on RBS and are migrating to present a more unified front and enable easier development of type checking libraries on top of it.

Very little of this will need to be written by hand. The underlying tech is pretty decent at guessing types, the idea is that if it's not quite specific enough you adjust it, but it should otherwise be transparent.


(One of core devs on Sorbet)

Agreed. But don't read too much in RBS details yet. RBI is currently very early and will need to change substantially learning from experience of actually typechecking real codebases. Stripe and Shopify are helping with this.

RBS has better syntax, but has features that don't have clear semantics or feasible implementation. And doesn't support inline annotations that are necessary in practice.

RBI is limited by ruby syntax and thus isn't as nice, but has good semantics and support inline annotations. And has been tried on hundreds of real codebases including those with dozens of millions lines of code.

We'll need to gather benefits of both on our way forward.


Agreed. Currently at Square so watching some of this.

The best path forward will be a lot of discussion, especially around learnings with production codebases where possible.

Personally I prefer inline annotations, but want to explore the possibilities of both and see what comes of it. I've written on Sorbet in the past and have used it on a few toy projects.

Also working on some analysis documentation comparing the two if you'd be interested in chatting later. Feel free to DM @keystonelemur on Twitter.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: