4 ms·
Ruby has static type system built into the language. https://github.com/ruby/rbs https://github.com/ruby/rbs There are others you can use if you like.
by vinceguidry 1y ago
Ruby has static type system built into the language.
https://github.com/ruby/rbs https://github.com/ruby/rbs
There are others you can use if you like.
- wiseowise 1y agoUnusable mess. Ruby should take lessons from Python and TS on how to make proper gradual typing.
- Lio 1y agoI think a much better way forward is proposed by Jake Zimmerman[1] of the Sorbet team. That is to allow the runtime to parse RBS inline format comments. That retains Sorbet’s fast static checker and its runtime checks which Typescript compiled to JS lacks. 1. https://blog.jez.io/history-of-sorbet-syntax/ https://blog.jez.io/history-of-sorbet-syntax/
- frou_dh 1y agoIt should stay true to itself and not do it at all. Sigh - all languages needn't converge into Grey Goo.
- burnt-resistor 1y agosteep and rbs don't work so well and are the wrong approach. sorbet is also the wrong approach but it works better. The Python 2 -> 3 way would've been a better way to do it but Matz chose an unwise way (separate files) that doomed it combined with a failure to type all the things and make it work. Oh, and very few Ruby gems are cryptographically signed and so most code is mostly untrustworthy. Making important things optional makes them unused and essentially worthless.
- vinceguidry 1y agoAll of these problems are worse in javascript. > a failure to type all the things and make it work Everything is typed in Ruby.