Re:RBS, Ruby’s new type signature language
by inopinatus on Wednesday July 29, 2020 @10:27PM
(#23993798)
It also leaves a big question-mark over how this fits into the REPL, and how we might create type definitions dynamically, since many classes in a running Ruby application are conjured by frameworks.
Re:RBS, Ruby’s new type signature language
by halostatue on Thursday July 30, 2020 @12:57AM
(#23994822)
At the moment, I’m disappointed in Sorbet’s capabilities‡, and it’s definitely not usable to me for the libraries that I maintain. I will (theoretically) be able to use Steep with _zero_ negative impact on deliverability.
Re:RBS, Ruby’s new type signature language
by cutler on Wednesday July 29, 2020 @07:18PM
(#23992620)
Surely a good IDE such as RubyMine would be able to display the type in reponse to, say, a mouseover?
Re:RBS, Ruby’s new type signature language
by derwiki on Wednesday July 29, 2020 @08:47PM
(#23993178)
RubyMine tries but it certainly works less well than PyCharm and GoLand.
But that is because it lacks type information. With type information added via RBS (or whatever other mechanism), they'd be able to parse that.
Re:RBS, Ruby’s new type signature language
by imhoguy on Thursday July 30, 2020 @03:51AM
(#23995686)
Go is statically typed.
RubyMine works great if you add yard type docs to your code.
Is it checking those types or just reporting then?
I’ve seen so many instances where yard doc has the wrong return type or misses a return type that I rarely trust it.
It doesn't do typechecks, no. You can use solargraph (https://github.com/castwide/solargraph) for that.
This is a big disappointment to me, one of the main advantages of static typing is that it can make code much easier to understand when types are added to non-obvious method parameters.