Hacker News new | ask | show | jobs
by albntomat0 2162 days ago
They are not the same, at least according to the definitions I'm familiar with.

Static/dynamic is whether type checking is done at compile time or run type.

Strong/weak is how flexible the language is with type conversion.

Another explanation: https://en.hexlet.io/courses/intro_to_programming/lessons/ty...

2 comments

Are these dimensions orthogonal though? For example is there any Strongly typed dynamic language?
Python is considered strongly typed, but usually it's placed in opposition with PHP or JavaScript. That's why I don't understand why the previous poster used strongly typed. The conversation was about static and dynamic programming languages.
Yes. Completely orthogonal.

Strongly typed dynamic: Python

Weakly typed dynamic: Javascript

Strongly typed static: Haskell

Weakly typed static: C

I think Python is mentioned as the usual example.
Static vs dynamic is not for type checking, it's about conversion.

As in:

Static typing - 1 == "1" is false (Python style, integer isn't converted to string for comparison)

Dynamic typing - 1 == "1" is true (PHP style, integer or string may be converted)

Where are you getting your definitions from? What you posted is what I understand to be weak vs strong.
Barbara Liskov defines strong typing as a compiler feature that prevents wrong type usage.

Liskov, B; Zilles, S (1974). "Programming with abstract data types".

http://web.cs.iastate.edu/~hridesh/teaching/362/07/01/papers...