Hacker News new | ask | show | jobs
by DonaldPShimoda 49 days ago
There is no consistent definition of the term "weak typing". Do you mean implicit coercion?

> Most people who think they have a problem with dynamic typing actually have a problem with weak typing.

Ironically, I would counter that, in my experience, most people who have a problem with static typing actually have a problem with verbose type systems, like Java's or C++'s — or Rust's. (Rust is at least gaining something for its verbosity.)

Type inference is a neat way to bridge the gap. OCaml, Haskell, and Swift (to name a few) all feature distinct type inferencing that give you the benefits of static types without as much syntactic overhead.

3 comments

To be clear, I don't have a problem with static typing. It has it's place, but all things being equal, I prefer dynamic (or even better, gradual) typing. I never put much water into the various verbosity criticisms, whether it's about type systems or file reading in Java.
Nim type inference was a joy to use although I haven't touched the language in several years due to the language community seeming to collapse a bit.
I deeply deeply want to love OCaml but its inherent lack of dynamic dispatch for int / float / complex is brutal