Ruby3 Will Have Types

Gerald Bauer <[email protected]>
Newsgroups gmane.comp.lang.ruby.general
Message-ID <CAAxEZd-ggqOq66d7rVccX4rNaNpu2z5sJUW=Rjim08qEGXqa7A@mail.gmail.com>
Hello,

   Today's biggest (most upvoted) story on Hacker News:

   Ruby3 Will Have Types [1]

   Any comments or thoughts here on ruby-talk about the breaking news?

  Here are my two cents:

  As a head start you can add the missing Bool type today :-), use the
safebool library / gem [2]

   Sorbet is a great inspiring project. Hopefully, open source soon.
FYI: sruby - that is (secure) ruby [3] - is an alternative ruby
(subset) with an alternative (optional) type annotation syntax e.g.

   Sorbet's `sig {params(x: Integer).returns(String)}`

  becomes

  `sig [Integer] => [String]` or `sig Integer => String`

Note: Since the sig is "yes, it's just (regular) ruby" code you can
create an alias for types e.g. I = Integer, S = String and than use
sig I=>S, for example.

   Cheers. Prost. Happy (type-safe) coding with ruby.

[1] https://news.ycombinator.com/item?id=19697405
[2] https://github.com/s6ruby/safebool
[3] https://github.com/s6ruby

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.