News for hackers. Stuff that matters.
Re:Ruby: We have decided to go forward to 3.0 this year by pmarreck on Monday August 31, 2020 @11:50AM (#24332648)
looks like they're adding an optional type system, which means you get the worst of both worlds- no guarantees AND no compile-time type checking (think: what happens if type-checked code calls non-typed code?) so I have no idea how they're going to make that fast since all types will still have to be checked at runtime
Re:Ruby: We have decided to go forward to 3.0 this year by sosodev on Monday August 31, 2020 @11:56AM (#24332702)
Are you sure it’ll be awful? Sorbet (https://sorbet.org/) is pretty popular already. It can statically check your whole project and dynamically check it at runtime. It also doesn’t add that much overhead so I’m not sure what you’re on about...
Re:Ruby: We have decided to go forward to 3.0 this year by pmarreck on Monday August 31, 2020 @12:08PM (#24332800)
What does it do with your library code that isn't type-specified? If it infers types, isn't there a limit as to how far that can go?
Re:Ruby: We have decided to go forward to 3.0 this year by dbalatero on Monday August 31, 2020 @12:31PM (#24333063)
Not sure what Ruby core will do, but Sorbet will type everything as T.untyped in the absence of type hints. Libraries can progressively provide rbi files to add first class type support though.
Re:Ruby: We have decided to go forward to 3.0 this year by oomkiller on Monday August 31, 2020 @12:30PM (#24333042)
Sorbet looks really cool, too bad they developed their own typing system that keeps types in a totally separate file instead of adopting it.
Re:Ruby: We have decided to go forward to 3.0 this year by jamesgeck0 on Monday August 31, 2020 @01:48PM (#24333999)
Sorbet was developed before the details of the new Ruby type system were locked in. They’re working on providing some convergence in upcoming releases.
Re:Ruby: We have decided to go forward to 3.0 this year by tomc1985 on Monday August 31, 2020 @02:05PM (#24334189)
The 'separate' file is to avoid breaking backwards compatibility and avoiding a Python2/3 fiasco
Re:Ruby: We have decided to go forward to 3.0 this year by virtue3 on Monday August 31, 2020 @03:28PM (#24335097)
Also see coffeescript, etc.
Re:Ruby: We have decided to go forward to 3.0 this year by Lio on Monday August 31, 2020 @02:27PM (#24334430)
Sorbet will be compatible with the new file format. We’ll still be able to use the inline Sorbet type signatures.

My personal hope is that typing can be included in test/spec files.

Re:Ruby: We have decided to go forward to 3.0 this year by cjohnson318 on Monday August 31, 2020 @12:07PM (#24332789)
I use type hints in Python to make my code more readable and more clearly convey my intent, although I rarely use analysis tools.
Re:Ruby: We have decided to go forward to 3.0 this year by jnwatson on Monday August 31, 2020 @02:02PM (#24334161)
It works great for Python.