4 ms·
> Properly statically typed languages do not need run-time checks Well, what's a properly compiled language these days? Golang e.g. uses run-time dispatching d
by G3rn0ti 5y ago
> Properly statically typed languages do not need run-time checks
Well, what's a properly compiled language these days? Golang e.g. uses run-time dispatching due to the way interfaces work and, of course, garbage collection. Even C++ needs to do run-time dispatching of virtual methods. So the only languages left these days that do not use run-time checks are probably C and Fortran.
- de_keyboard 5y agoI mean run-time checks that the user must implement. For example, in JS you might put these all over your code-base: if (typeof x !== 'string') { throw Error('Expected a string'); }
- zohch 5y agoThis will already inform mypy that after that if statement x is type string.