3 ms·
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 imp
by pxc 1y ago
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.
- phoronixrly 1y agoOh 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.
- Lio 1y agoI'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 https://sorbet.org/docs/rbs-support