Does “untyped” also mean “dynamically typed” in the academic CS world?

前端 未结 9 2080
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 17:17

I\'m reading a slide deck that states \"JavaScript is untyped.\" This contradicted what I thought to be true so I started digging to try and learn more.

Every answer

9条回答
  •  执念已碎
    2020-11-30 17:45

    I am not a computer scientist, but I would be rather surprised if "untyped" were really used as a synonym for "dynamically typed" in the CS community (at least in scientific publications) as imho those two terms describe different concepts. A dynamically typed language has a notion of types and it enforces the type constraints at runtime (you can't for example divide an integer by a string in Lisp without getting an error) while an untyped language doesn't have any notion of types at all (e.g. assembler). Even the Wikipedia article about programming languages (http://en.m.wikipedia.org/wiki/Programming_language#Typed_versus_untyped_languages) makes this distinction.

    Update: Maybe the confusion comes from the fact that some texts say something to the extent that "variables are not typed" in Javascript (which is true). But that doesn't automatically mean that the language is untyped (which would be false).

提交回复
热议问题