Hacker News new | ask | show | jobs
by dkarapetyan 3625 days ago
These are all great but when are we getting optional typing? If the js ecosystem wasn't a clown operation my language of choice would be typescript instead of ruby.
2 comments

It's not on agenda and it will never happen. There are so many languages with fine typing, why break a dynamic one by adding stuff to it?
> It's not on agenda and it will never happen.

I believe Matz has said that it is on the agenda for Ruby 3.0: that it will have static typing and that it will be optional.

TIL, I guess that making Ruby 3.0 3x faster (3x3 initiative) and adding optional static typing at the same time might be quite hard.
I think the person you are replying to will disagree that it is "breaking" the language.
If you like types, why would you use TypeScript over Elm? http://elm-lang.org/
Because I like optional types. I don't like the type system dictating the entire design.
I like optional types as well, but more because I'm lazy. The Elm and Haskell people are not complaining about types, and given that every function takes SOMEthing (of some implicit type) and usually spits out SOMEthing (of some implicit type), I can hardly see how it will "dictate the design" more than create a bit more validation code.
Not having this flame war. I have my reasons, you have yours. We will continue writing code using our separate ways. Certain patterns are awkward or even impossible in statically typed languages and you need to bypass the type system to get things done so implicit or not, static type systems have a cost. There is a benefit as well but the kinds of systems I work on I don't need the extra validation. I need the ability to quickly prototype and ship and then layer on the validation, hence the need for optional types.
Didn't think I was starting a flame war, I thought we were having a stimulating discussion, actually, but the two are often confused online unfortunately. I don't use any statically typed languages myself, so there is no reason for me to advocate for them from a personal bias standpoint, I was just saying that the people who DO use them seem to be pretty sold on them. Your criticisms are valid of course!