Open ChillerDragon opened 10 months ago
There is also steep https://github.com/soutaro/steep
Okay it seems there is something brand new that is official. That is rbs. Some dude on stackoverflow said that ruby standard lib tries to move to that. It is not a type checker. It is additional files in your code base describing the types. And we can then use steep as type checker on those rbs types.
About the author: Soutaro is a lead Ruby engineer at Square working on Steep, RBS, and static typing. He is a core Ruby committer working with Matz and other core committers on the RBS specification that will ship with Ruby 3.
https://developer.squareup.com/blog/the-state-of-ruby-3-typing/
Okay sorbet seems to use rbi for type annotations which is their thing and its not compatible. Why official ruby in 2020 started supporting rbs type annotations and their official checker for that is steep. So lets go with that!
Having types not in the code feels weird. But at least they do not pollute runtime. Sorbet has its types in the code directly. But it also does type checking at runtime which sounds like a performance hit to me.
rbs can and should be generated using https://github.com/ruby/typeprof
https://sorbet.org/docs/overview