| |||||||||
One major distinction made in the nature and behaviour of programming languages is that of its typing.
In statically typed programming languages, every program expression is assigned a type before program execution; usually, it is sufficient to assign a type to every variable, as this uniquely determines a type for the rest of the program.
In dynamically typed programming languages, variables are not assigned a static type, but (if the language is type-safe) then values carry around a dynamic type.
Dynamically typed languages are also called untyped or type-free languages.
There are two ways to compare statically typed and dynamically typed languages: type-erasure and embedding.
Examples of statically typed programming languages:
Examples of dynamically typed programming languages: