It looks like they've conflated type with class. If so, that's the antithesis of duck typing. The impedence mismatch to Ruby seems to me an overwhelming contraindication.
Do you have any reference to any documentation of how they implemented types?
Types will be part of Ruby 3 stdlib source
21–30 of 216 posts
Re: Types will be part of Ruby 3 stdlib source
#22Why is everything moving to types?
Re: Types will be part of Ruby 3 stdlib source
#23Re: Types will be part of Ruby 3 stdlib source
#24Why is everything moving to types?
Re: Types will be part of Ruby 3 stdlib source
#25Why is everything moving to types?
But it is always an incomplete solution because a) old code needs to be retrofitted, see TypeScript's way of defining type maps for vanilla JS or b) more commonly you keep the code around that's using unsafe types, effectively passing void*|Object|"choose your poison" around.
Re: Types will be part of Ruby 3 stdlib source
#26Why is everything moving to types?
I don’t know but I hate it. Not sure if I’m in the minority but it sure feels like it. In an ideal world. I feel that types are something that should be dealt with at the IDE level. In fact, there so many things that can be done at that level, but no one has really been brave enough to do so I suppose.
I'm personally tired of staring at variables trying to figure out what they're supposed to be, then having to dive into source to see how its used. C/C++/C# solved that problem, why are we still dealing with it?
Re: Types will be part of Ruby 3 stdlib source
#27Re: Types will be part of Ruby 3 stdlib source
#28Why is everything moving to types?
I don’t know but I hate it. Not sure if I’m in the minority but it sure feels like it. In an ideal world. I feel that types are something that should be dealt with at the IDE level. In fact, there so many things that can be done at that level, but no one has really been brave enough to do so I suppose.
Depending on your type system, a well-typed program can eg run faster, because the compiler / interpreter can elide certain runtime safety checks that would be necessary in untyped code.
If your type system is crazy enough, you can even track the runtime complexity of your program at the type level, including whether your program runs in finite time. See eg Dhall (https://dhall-lang.org/) whose type systems only allows programs running in finite time.
Re: Types will be part of Ruby 3 stdlib source
#29Why is everything moving to types?
Re: Types will be part of Ruby 3 stdlib source
#30Interesting. I thought the Ruby community generally prefers shorter code, e.g. `to_s` instead of `to_string`, and yet that type signature is very verbose: `sig {params(x: Integer).returns(String)}`
“foo”.class # => String