Re:The Next Step for Generics
by randomdude402 on Wednesday June 17, 2020 @12:57AM
(#23547966)
Agree that there's a big difference between the error happening at compile time vs. happening at run time in prod, but I personally find the python stacktrace much more descriptive of how we got to the error than a lot of other languages.
A certain amount of it is probably a familiarity thing, but I do usually find myself able to parse it to the point of what line in which file things started to go wrong.
Re:The Next Step for Generics
by unrealhoang on Wednesday June 17, 2020 @10:52AM
(#23552123)
Other languages can do the same, they just deliberately make the decision not to because of performance. Ruby has the same nice stacktrace (even nicer).
There was some work that took ML compile time errors and created Python-like stacktraces of how this specific error could blow up at runtime in a Python-like fashion. Students found those concrete errors with concrete values easier to reason about than abstract compile time errors.
A statically typed language with compile-time type checking would flag that immediately, and chances are your IDE will show the error before it even gets to that point.
Type hints are a thing, but then you are already moving in that direction while remaining in python.