Details, Explanation and Meaning About Array programming

Array programming Guide, Meaning , Facts, Information and Description

Array programming languages (also known as vector or multidimensional languages) generalize operations on scalars to apply transparently to vectors, matrices, and higher dimensional arrays.

APL, by Ken Iverson, was the first programming language to provide Array Programming capabilities.

The fundamental idea behind Array Programming is that operations apply at once to an entire set of values. This makes it a high-level programming model as it allows the programmer to think and operate on whole aggregates of data, without having to resort to explicit loops of individual scalar operations.

Array Programming primitives concisely express broad ideas about data manipulation. The level of conciseness can be dramatic in certain cases: it is not uncommon to find array programming language one-liners that require more than a couple of pages of Java code.

Array Programming is very well suited to implicit parallelization; a topic of much research nowadays.

Function rank is an important new computer science concept that has recently been discovered as a result of Array Programming research in the J programming language.

Table of contents
1 Overview
2 Example languages
3 See also
4 External links

Overview

In scalar languages like FORTRAN, C, Pascal, Ada, etc. operations apply only to single values, so a+b expresses the addition of two numbers. In such languages adding two arrays requires indexing and looping:

FORTRAN 77

   DO 10 I = 1, N
     DO 10 J = 1, N
10       A(I,J) = A(I,J) + B(I,J)

C
     for ( i=0; i
This need to loop and index to perform operations on arrays is both tedious and error prone.

In array languages, operations are generalized to apply to both scalars and arrays. Thus, a+b expresses the sum of two scalars if a and b are scalars, or the sum of two arrays if they are arrays. When applied to arrays, the operations act on corresponding elements as illustrated in the loops above. Indeed, when the an array language compiler/interpreter encounters an statement like:

A := A + B

and A and B are two dimensional arrays, it generates code that is effectively the same as the C loops shown above. An array language, therefore, simplifies programming.

Example languages

The canonical example of an array programming language is APL. Others include: J, K, NGL, and ZPL.

provides an exhaustive list.

See also

External links

"no stinking loops" programming


This is an Article on Array programming. Page Contains Information, Facts Details or Explanation Guide About Array programming


Google
 
Web www.E-paranoids.com

Search Anything