3 ms·
Some people use "type" exclusively to refer to compile-time entities. By this definition, languages that are commonly referred to as "dynamically-typed" are act
by ekiru 16y ago
Some people use "type" exclusively to refer to compile-time entities. By this definition, languages that are commonly referred to as "dynamically-typed" are actually "untyped", because they have only one compile-time type, which is essentially the same as having no types.
- silentbicycle 16y agoThat's confusing weak/strong with static/dynamic typing, though. (A common error.) "What To Know Before Debating Type Systems" (http://www.pphsg.org/cdsmith/types.html http://www.pphsg.org/cdsmith/types.html) is a pretty good introduction to types. Also, while I'm only partway through Benjamin Pierce's _Types and Programming Languages_, it's been quite good so far.
- ekiru 16y agoActually, your link agrees with my explanation: It points out in the "Static and Dynamic Types" section that what is meant by "type" in static type-systems and what is meant by "type" in dynamic type-systems are two very different concepts. From the perspective of someone interested in static "types", dynamically-typed languages don't have types at all.
- Zaak 16y agoSpecifically, this is the definition used in Computer Science research. Unfortunately, the communication between that community and the larger community of programmers is so poor that it was several years after I finished my CS bachelor's degree before I figured out why some people insisted that languages like Python were "untyped".
- DrSprout 16y agoIt's rather semantic, but I would differentiate typed from untyped by type checking vs. type being an inherent property of a variable. So you have something in Scheme like: (define foo 1) (define bar "1") And that is typed, the former being a number, the latter a string. If you try to subsequently do: (+ foo bar) the program will error out. Contrast this with what I would consider an untyped language like Python or Perl, where the translation from string to number is done without any warnings showing up.