FACTOID # 17: Senior gentlemen might consider a trip to Russia, where there are two women over 65 for every man.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Array programming language

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. Today, Fortran 95 and Matlab are probably the most widely used compiled and interpreted array programming languages.


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.

Contents

Overview

In scalar languages like FORTRAN 77, 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<n; i++) { for ( j=0; j<n; j++) { a[i][j] = a[i][j]+b[i][j]; } } 

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 examples of array programming languages are APL and Fortran 95. Others include: J, K, NGL, and ZPL.


Category:Array programming languages provides an exhaustive list.


See also

External links

"no stinking loops" programming (http://www.nsl.com/)




  Results from FactBites:
 
Programming Languages, Computer, Java, JavaScript, C++, Services, Perl, HTML, PHP (17622 words)
A programming language should both provide means to describe primitive data and procedures and means to combine and abstract those into more complex ones.
With its emphasis on program safety, it is not surprising that Ada is a strongly typed language: all data elements must be declared as storing a particular type or subtype, and type enforcement is strictly applied both within and between modules.
The basic view of programming exhibited by Escher and related languages is the a program is a representation of a theory in some logic framework, and the program's execution (computation) is a deduction from the theory.
MSN Encarta - Romania (1012 words)
  More results at FactBites »


 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m