views:

148

answers:

1

I'd like to understand the advantages of super-strong typing, a la SML or Scala, over conventionally strongly typed languages such as Java or c++. Could someone give a brief overview of the advantages of very strong typing, or better yet, post an example of an error which would be caught at compile time in very strongly typed language, versus run-time in the common strongly-typed languages.

I'm posting this from a complete position of ignorance, and I'm genuinely interested in what strict typing brings to the table when writing software.

+3  A: 

I've been doing some SML programming, and the main advantages were:

  • many more errors are caught at compile-time, which reduces testing effort
  • strong-typing enables whole-program optimizations, which in turn can produce faster code, sometimes even faster than that of C and C++ (see MLTon compiler)
  • it makes it more feasible to statically verify (prove) program correctness
zvrba