Science  People  Locations  Timeline
Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Home > Datatype


 Contents
In computer science, a datatype (often simply type) is a name or label for a set of values and some operations which can be performed on that set of values. Programming languages implicitly or explicitly support one or more datatypes; these types may act as a statically or dynamically checked constraint on the programs that can be written in a given language.

1 Basis

The basic idea of typing is to give some semantic meaning to what is ultimately just mere bits. Types are usually associated either with values in memory or with objects such as variables. Because any value is simply a set of bits for computers, there is no distinction in hardware even among memory addresses, instruction code, characters, integers and floating-point numbers. Types tell you how you should treat those mere bits.

Major functions that type systems provide are:

Typically each value is associated with one particular type although a type may have more than one subtype. Other entities, such as objects, modules, communication channels, dependencies, or even types themselves can be associated with a type. For example, a datatype is a type of a value, a classIn object-oriented programming, a class consists of encapsulated instance variables and subprograms, the methods mentioned below. A Class describes the rules by which objects behave; these objects are referred to as " instances" of that class. A class spe is a type of an object and a kind is a type of a type.

A type system, specified in each programming language, stipulates the ways typed programs are allowed to behave and makes behavior outside these rules illegal. An effect systemAn effect system is a formal system which describes the computational effects of computer programs, such as side effects. An effect system can be used to provide a compile-time checking of the possible effects of the program. An effect system is typically is typically more fine-grained than a type system.

More formally, the study of type systems is known as type theoryMathematical logic At the broadest level, type theory is the branch of mathematics and logic that concerns itself with classifying entities into sets called types''. In this sense, it is related to the metaphysical notion of 'type'. Modern type theory was, with the aid of lambda calculusThe lambda calculus is a formal system designed to investigate function definition, function application, and recursion. It was introduced by Alonzo Church and Stephen Cole Kleene in the 1930s; Church used the lambda calculus in 1936 to give a negative an.



Read more »

Non User