▲ | 12_throw_away 4 days ago | ||||||||||||||||||||||
I write and test a lot of both rust and python, so I can say quite confidently: 1. Of course a type system is not as "flexible" as arbitrary test code. 2. Compiler-enforced type safety is many orders of magnitude easier to maintain than the equivalent unit tests 3. Defining rigorously enforced invariants with a type system is far, far more powerful than hoping you remembered to test all the important cases. | |||||||||||||||||||||||
▲ | d0mine 3 days ago | parent [-] | ||||||||||||||||||||||
Your 2-3 points remind me of the quote by Ludwig Wittgenstein: “The limits of my language means the limits of my world.” Of course if you limit yourself only to problems that can be effectively solved by type system, then it may work. It is like limiting yourself only to those text processing tasks where regexs work. Yes, some text processing tasks may be much more effectively solved using a regex. But it is obvious that at some point in a more general case grep can’t replace python. It may be less apparent for compiler vs. python case but the general logic is the same. | |||||||||||||||||||||||
|