This question arises from this question.
One saying is that if a language has the type string or float, etc, then it is typed. But what if it also fits Wikipedia’s explanation of untyped:
http://en.wikipedia.org/wiki/Programming_language#Typed_versus_untyped_languages
an untyped language, such as most
assembly languages, allows any
operation to be performed on any data,
which are generally considered to be
sequences of bits of various lengths.
High-level languages which are untyped
include BCPL and some varieties of
Forth.
so what if the language allows operations on any data, but just return “undefined” or “NaN”, can we say it is untyped even though it has string and float, etc?
Are string, array, and object not considered to be “sequences of bits of various lengths”? Does the “sequences of bits of various lengths” actually means “sequences of bits of some pre-defined lengths on the system (such as 32 bit, 64 bit, etc)”?
If the languages has types like “string” and “float” then it is typed. Whether it is statically typed or dynamically typed is another issue. Untyped languages work with memory directly whereas typed languages have an abstraction layer over memory (the types themselves).
This sounds like a dynamic, weakly-typed language that relies on duck typing to operate on types, not directly on memory. What does “NaN” mean in a language that has no types? If the interpreter/compiler of the language you are using is capable of determining that a value found at a memory address is “not a number” then that language is type-aware. An untyped language doesn’t care about types at all – it simply manipulates memory directly.