google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.34k stars 212 forks source link

Untyped? #260

Closed AlekSi closed 4 years ago

AlekSi commented 4 years ago

starlark-go README calls Starlark an "untyped dynamic language." I'm a bit confused about why it is untyped since types are clearly there. https://github.com/bazelbuild/starlark calls it "dynamically typed language," which sounds closer to the truth.

alandonovan commented 4 years ago

The meaning of the term "type" has been debated for nearly a century, and there are several different viewpoints. To a logician, a type is a collection of values over which a function is defined. To a runtime implementer, a type is a value that describes the structure and operations of another value. To a compiler writer or type theorist, a type is a static classification of expressions by the values they compute, that may be used to prove the absence of certain errors. The documentation alludes to this last meaning.

I don't think "dynamically typed" is a particularly useful description as there are exceptionally few languages that are not dynamically typed. (The only examples I can think of are B and assembly languages, whose sole data type is 'machine word'.)

laurentlb commented 4 years ago

I think it would be clearer to drop the word "untyped". "Untyped" is misleading when we have a type() function and the user can get type errors.

The terms "dynamic language" or "dynamically typed language" are more common (meaning that the type information is not known statically).