Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Smalltalk sometimes called "dynamically typed"?

I try to understand why Smalltalk is sometimes called "dynamically typed" and not "untyped" which i also read a lot and which seems to make perfect sense.

There are no type annotations for variables, parameters and method returns in Smalltalk - so what would you compare the type of an object (if you say the type of the object is it's class) to?

Also dynamically typed is not the same as dynamically type-checked? So if Smalltalk was dynamically typed it would mean, that internally Smalltalk does give types to variables, parameters, method returns at runtime? does it?

like image 408
Helene Bilbo Avatar asked Feb 13 '26 05:02

Helene Bilbo


2 Answers

"Dynamically typed" is widely used in certain programming language communities to mean "dynamically checked". Likewise, in more theory-oriented circles it is widely regarded as being technically misleading, because what is being checked is not types in any formal sense of the word. However, that usage is far too common these days for any chance of correcting it.

See also my answer to the inverse question for a bit more background.

like image 65
Andreas Rossberg Avatar answered Feb 15 '26 15:02

Andreas Rossberg


One convention is to compare programming languages along two dimensions:

  • A continuum from Dynamic Typing to Static Typing
  • A continuum from Strong Typing to Weak Typing

Dynamic Typing often means that the types are not checked at compile time, whereas they are for Static Typing.

Strong Typing often means that types at run-time are of a distinct type which never changes, whereas Weak Typing means that the underlying type can be changed according to context.

It is said that Smalltalk has Strong Dynamic Typing.

like image 40
quamrana Avatar answered Feb 15 '26 14:02

quamrana