News for hackers. Stuff that matters.
Re:RBS, Ruby’s new type signature language by ric2b on Wednesday July 29, 2020 @05:57PM (#23992023)
> I'm surprised that it does not seem to have syntax for type definitions in code

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.

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.

‡ https://github.com/sorbet/sorbet/issues/3252

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.
Re:RBS, Ruby’s new type signature language by vidarh on Thursday July 30, 2020 @04:34AM (#23995884)
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.
Re:RBS, Ruby’s new type signature language by d3nj4l on Thursday July 30, 2020 @12:58AM (#23994829)
RubyMine works great if you add yard type docs to your code.
Re:RBS, Ruby’s new type signature language by Lio on Thursday July 30, 2020 @02:13AM (#23995187)
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.

Re:RBS, Ruby’s new type signature language by d3nj4l on Thursday July 30, 2020 @05:55AM (#23996315)
It doesn't do typechecks, no. You can use solargraph (https://github.com/castwide/solargraph) for that.