3 ms·
None of that would be a problem in a typed language. The ultimate destination of any string literal is some standard library function, whether that's write to n
by lmm 7y ago
None of that would be a problem in a typed language. The ultimate destination of any string literal is some standard library function, whether that's write to network socket, display to user, or something else. So you just ripple backwards from that through your own functions that are calling those standard library functions, until you get to the point where you're passing in the literal, and then you know what kind of literal it needs to be.
- war1025 7y agoThat's not really much different from the path we took. It's just instead of running the compiler, we ran the linter and test suite until things passed. It's just when you have a million lines of code that takes quite a while.
- vmchale 7y ago> None of that would be a problem in a typed language. Python is dynamically typed and weakly typed, but still typed. That's precisely the problem! The difference is just that a statically typed language gives you all the information, and a dynamically language doesn't, but still fails. Just without providing you the necessary information up-front. There's a nice explanation here: https://existentialtype.wordpress.com/2011/03/19/dynamic-languages-are-static-languages/ https://existentialtype.wordpress.com/2011/03/19/dynamic-lan...
- lmm 7y ago> Python is dynamically typed and weakly typed, but still typed. People who claim that dynamic typing is a thing claim that Python is strongly typed. (This is of course nonsense; there's no such thing as dynamic typing, because types are by definition something that expressions in a language have, not something that runtime values have). > There's a nice explanation here: https://existentialtype.wordpress.com/2011/03/19/dynamic-lan.. https://existentialtype.wordpress.com/2011/03/19/dynamic-lan.... That is not a "nice explanation". It is writing to obscure rather than to clarify. And it certainly acknowledges that one cannot have differently typed values in a dynamic language.