Typing

From Esolang
Jump to navigation Jump to search

Typing refers to how a language treats the concept of data types. There are different ways to treat it. Some languages call their type systems "strongly typed" but disagree as to what that means. Similarly, a variety of different systems are derided as "weakly typed". Therefore it's better to use more descriptive terms.

Variable typing means that the language associates a type to each variable, and the values placed in it must first be converted to that type. Examples include BASIC, Fortran, C, and Java.

Value typing means that the language associates the types to values, and a variable has no inherent type. Examples include PHP, Javascript, Python, and SQLite.

Operation typing means that values have no type, and the operations used determine what type the value is treated as. Examples include Forth, scrip7.

Single typing is the case where only one type of value is supported, so the distinctions above are obviated. Examples include Brainfuck, Befunge, and many other esolangs.

There are other ways too.