Friday, February 25, 2005

Closures

According to word iQ:

In programming languages, a closure is an abstraction representing a function, plus the lexical environment (see static scoping) in which the function was created.

Closures are typically implemented with a special data structure that contains a pointer to the function code, plus a representation of the function's lexical environment (ie, the set of available variables and their values) at the time when the closure was created.

Closures typically appear in languages that allow functions to be "first-class" values --- in other words, such languages allow functions to be passed as arguments, returned from function calls, bound to variable names, etc, just like simpler types such as strings and integers.

Dataflow

According to The Hyperdictionary:

A data flow architecture or language performs a computation when all the operands are available. Data flow is one kind of data driven architecture, the other is demand driven. It is a technique for specifying parallel computation at a fine-grain level, usually in the form of two-dimensional graphs in which instructions that are available for concurrent execution are written alongside each other while those that must be executed in sequence are written one under the other. Data dependencies between instructions are indicated by directed arcs. Instructions do not reference memory since the data dependence arcs allow data to be transmitted directly from the producing instructions to the consuming one.

According to Real Dictionary:

The order of execution in a {data driven} language is determined solely by the data dependencies. For example given the equations

1) X = A + B
2) B = 2 + 2
3) A = 3 + 4

a data-flow analysis would find that 2 and 3 must be evaluated before 1. Since there are no data dependencies betwen 2 and 3 they may be evaluated in any order including in parallel. This technique is implemented in {hardware} in some {pipelined} processors with multiple {functional units}. It allows instructions to be executed as soon as their inputs are available independent of the orginal program order.

Streams

According to The Free Dictionary:

An abstraction referring to any flow of data from a source (or sender, producer) to a single sink (or receiver, consumer). A stream usually flows through a channel of some kind, as opposed to packets which may be addressed and routed independently, possibly to multiple recipients. Streams usually require some mechanism for establishing a channel or a "connection" between the sender and receiver.

Continuations

According to Wikipedia:

"In computing, a continuation is a representation of an execution point (for example, the instruction pointer and stack frame). Many languages have constructs that allow a programmer to obtain a pointer to a continuation, and then to resume execution using the pointer at a later point in time. This technique has been used in functional programming, imperative programming, and message passing programming."

The most popular use of continuations today is in the implementation of exception handling.

Functions

According to Eric Weisstein et al at Mathworld:

A function is a relation that uniquely associates members of one set with members of another set. More formally, a function from A to B is an object f such that every a\∈A is uniquely associated with an object . A function is therefore a many-to-one (or sometimes one-to-one) relation. The set A of values at which a function is defined is called its domain, while the set B of values that the function can produce is called its range. The term "map" is synonymous with function.

Unfortunately, the term "function" is also used to refer to relations that map single points in the domain to possibly multiple points in the range. These "functions" are called multivalued functions (or multiple-valued functions), and arise prominently in the theory of complex functions, where the presence of multiple values engenders the use of so-called branch cuts.

Elementary Functions

According to Eric Weisstein et al at Mathworld:

A function built up of a finite combination of constant functions, field operations (addition, multiplication, division, and root extractions--the elementary operations)--and algebraic, exponential, and logarithmic functions and their inverses under repeated compositions (Shanks 1993, p. 145; Chow 1999). Among the simplest elementary functions are the logarithm, exponential function (including the hyperbolic functions), power function, and trigonometric functions.

Elementary Operations

According to Eric Weisstein et al at Mathworld:

One of the operations of addition, subtraction, multiplication, division, and integer (or rational) root extraction.

Algebraic Functions

According to Eric Weisstein et al at Mathworld:

A function which can be constructed using only a finite number of elementary operations together with the inverses of functions capable of being so constructed. Nonalgebraic functions are called transcendental functions.

Transcendental Functions

According to Eric Weisstein et al at Mathworld:

A function which is not an algebraic function. In other words, a function which "transcends," i.e., cannot be expressed in terms of, algebra. Examples of transcendental functions include the exponential function, the trigonometric functions, and the inverses functions of both.