4 ms·
There is so much wrong with this... > Safety: Each data carries it's type at run-time With a statically typed language, this is not necessary for safety, sinc
by adwn 9y ago
There is so much wrong with this...
> Safety: Each data carries it's type at run-time
With a statically typed language, this is not necessary for safety, since the compiler has already checked that the types are correct.
> there are no overflow
Do you mean integer overflow? This is completely orthogonal to the static/dynamic typing distinction.
> or NULL ptr problems as in statically typed languages
This is also completely orthogonal to the static/dynamic typing distinction. Remember that C and C++ do not constitute the entirety of statically typed languages.
> E.g. arithmetic is exact
What does this even mean?
> Memory Safety.
Again, C and C++ do not constitute the entirety of statically typed languages.
- rurban 9y ago> With a statically typed language, this is not necessary for safety, since the compiler has already checked that the types are correct Consensus is that static type checking did not help in ensuring memory and concurrency safety (sans the 2 or 3 weird safe languages nobody uses or knows about). The compiler cannot ensure these safeties when the language and VM is too poor to ensure it. I only know ATS, Pony, Idris, Agda and a few more who can ensure proper compile-time safety. Of course static type aficionados are in denial on this point. This is the argument mostly from the LISP community. For the static folks their type system is good enough. Fine for them. Other languages just do it better. As history has shown dynamically typed languages can easily ensure much more safeties. Esp. arithmetic safeties, with overflows, from int to bigint, from ops to rational, from double to bigfloat, ... This is not at all orthogonal to static/dynamic typing distinction, as the static type systems forbid that. Did you see any union typed arithmetic? Most dynamic languages have that. > NULL ptr problems completely orthogonal ... Of course not. I only know a few NULL safe statically typed languages nobody uses. Dynamically typed langs check for these issues in the runtime, thus are safe. > E.g. arithmetic is exact. What does this even mean? Oh my. Hope you will never be allowed to work in finance. I know nobody cares about getting numbers right, but speed is not everything. Avoiding underflows and overflows, guaranteeing exact arithmetic with proper type promotions. Ever heard of bigint or rationals? The world doesn't consist only of int, double and decimal. And with e.g. SBCL you have speed and safety. > Memory Safety. C and C++ ... But mostly. Add the next 3: Java, Rust, Go from which Rust is also not memory safe.