←back to thread

333 points steveklabnik | 3 comments | | HN request time: 0.203s | source
Show context
gurgeous ◴[] No.45035053[source]
I am so excited about this!! Ruby tooling is already pretty good, but we can do better. I will try to contribute. Now we just need types
replies(2): >>45035149 #>>45040884 #
dismalaf ◴[] No.45035149[source]
Please no types... They're worse than pointless for a dynamically typed language.
replies(5): >>45035235 #>>45035294 #>>45035575 #>>45035612 #>>45040464 #
1. pxc ◴[] No.45035575[source]
Sorbet can actually make programs crash at runtime if a variable's type doesn't match its annotation, right? It's not as busted as some other gradual typing implementations.
replies(2): >>45036553 #>>45037384 #
2. phoronixrly ◴[] No.45036553[source]
Oh exactly what I wanted - runtime overhead, on top of its lack of ability to accomodate ducktyped external dependencies in any sane way.

It does welcome nil proliferation though! Just sprinkle some `nilable` around and you're set to continue the actual scourge of the language.

3. Lio ◴[] No.45037384[source]
I'm definitely in favour of gradual typing but runtime checking is already really easy to do if that's what you want. Just add a rightward assignment patten match to your method. e.g.

  def somemethod(foo, bar)
    foo => Integer
    bar => MyBarClass
  end
Personally I think the RBS-Inine format is the way forward. Sorbet has experimental support for it too.

https://sorbet.org/docs/rbs-support