Very cool! I didn't think this would happen, as Matz has expressed disinterest in adding type annotations. However, keeping an open mind and reconsidering one's positions are the hallmarks of a great leader :D I worked on a summer project to add type annotations to Ruby. Didn't get very far since I ran into some challenges with the internals of the parser and the parser library, Ripper. I'm extremely interested in se…
Indeed Sorbet does have literal types for strings and Ruby symbols. We're still figuring out the details and converging on a common type system for Ruby3, but we've found them super useful, as you rightly point out! And +1 on the Ruby renaissance! Super excited about all the exciting things that are currently being built!
Types will be part of Ruby 3 stdlib source
11–20 of 216 posts
Re: Types will be part of Ruby 3 stdlib source
#12Nice! Reminds me of crystal[0], the LLVM-compiled ruby-alike language. 0: https://crystal-lang.org
Re: Types will be part of Ruby 3 stdlib source
#13Re: Types will be part of Ruby 3 stdlib source
#14It 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.
Classes are types by default, but you can define non-class types as well: https://sorbet.org/docs/abstract
Re: Types will be part of Ruby 3 stdlib source
#15Re: Types will be part of Ruby 3 stdlib source
#16Earlier quoted context omitted.
Indeed Sorbet does have literal types for strings and Ruby symbols. We're still figuring out the details and converging on a common type system for Ruby3, but we've found them super useful, as you rightly point out! And +1 on the Ruby renaissance! Super excited about all the exciting things that are currently being built!
I can't wait for Sorbet's open sourcing! Ngl I tried decompiling the wasm binary just for fun. Not that it ended up being readable haha
Re: Types will be part of Ruby 3 stdlib source
#17Re: Types will be part of Ruby 3 stdlib source
#18Why is everything moving to types?
Re: Types will be part of Ruby 3 stdlib source
#19Re: Types will be part of Ruby 3 stdlib source
#20Types will be optional right? Otherwise I am gonna have to jump ship sadly.