Types in programming languages are inspired by mathematical set theory.
Basic Type Systems
In a language, such as J, with dynamic types and run-time type checking each value has a type and just as the value assigned to a variable can change so the type is allowed to change as the value changes, e.g.
Depending on the language, the action taken by an operator can vary with the type(s) of the operand(s), e.g.
-- assuming `+' represents both numerical addition and string concatenation.
Most compiled programming languages have static types and compile-time type checking, e.g.
Static type checking guarantees that a wide class of programming errors in which an operator is applied to the wrong type of operand cannot occur when the program runs.
Static type checking also allows operators to be overloaded with different meanings, different code sequences, e.g.
and so on, as the language designer chooses. This is achieved with no run-time penalty.
A programming language will provide some atomic types,
generally including Int, Real, Boolean, and Char, and
some structured types possibly including
array ([ ]), tuple (record, structure),
↑ © L. Allison, www.allisons.org/ll/ (or as otherwise indicated).
Created with "vi (Linux)", charset=iso-8859-1, fetched Thursday, 15-Apr-2021 10:41:51 EDT.
Free: Linux, Ubuntu operating-sys, OpenOffice office-suite, The GIMP ~photoshop, Firefox web-browser, FlashBlock flash on/off.