Content deleted Content added
→Array languages: this was a thesis |
Citation bot (talk | contribs) Alter: url. URLs might have been anonymized. Add: s2cid, authors 1-1. Removed proxy/dead URL that duplicated identifier. Removed access-date with no URL. Removed parameters. Some additions/deletions were parameter name changes. | Use this bot. Report bugs. | Suggested by Abductive | Category:Programming paradigms | #UCB_Category 44/113 |
||
Line 2:
In [[computer science]], '''array programming''' refers to solutions which allow the application of operations to an entire set of values at once. Such solutions are commonly used in [[computational science|scientific]] and [[engineering]] settings.
Modern programming languages that support array programming (also known as [[vector (computing)|vector]] or '''multidimensional''' languages) have been engineered specifically to generalize operations on [[scalar (computing)|scalar]]s to apply transparently to [[vector (geometric)|vector]]s, [[matrix (mathematics)|matrices]], and higher-dimensional arrays. These include [[APL (programming language)|APL]], [[J (programming language)|J]], [[Fortran 90]], Mata, [[MATLAB]], [[Analytica (software)|Analytica]], [[TK Solver]] (as lists), [[GNU Octave|Octave]], [[R (programming language)|R]], [[Cilk Plus]], [[Julia (programming language)|Julia]], [[Perl Data Language|Perl Data Language (PDL)]], and the [[NumPy]] extension to [[Python (programming language)|Python]]. In these languages, an operation that operates on entire arrays can be called a ''vectorized'' operation,<ref>{{cite journal |title=The NumPy array: a structure for efficient numerical computation |author=Stéfan van der Walt |author2=S. Chris Colbert |author3=Gaël Varoquaux |name-list-style=amp |journal=Computing in Science and Engineering |volume=13 |issue=2 |pages=22–30 |publisher=IEEE |year=2011 |doi=10.1109/mcse.2011.37|bibcode=2011CSE....13b..22V |arxiv=1102.1523 |s2cid=16907816 }}</ref> regardless of whether it is executed on a [[vector processor]], which implements vector instructions. Array programming primitives concisely express broad ideas about data manipulation. The level of concision can be dramatic in certain cases: it is not uncommon to find array programming language [[one-liner program|one-liners]] that require several pages of object-oriented code.
==Concepts of array==
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 language|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.
[[Kenneth E. Iverson]] described the rationale behind array programming (actually referring to APL) as follows:<ref>{{cite journal |author= Iverson, K. E. |title= Notations as a Tool of Thought. |journal= Communications of the ACM |volume= 23 |issue= 8 |pages= 444–465 |year= 1980
{{quote|most programming languages are decidedly inferior to mathematical notation and are little used as tools of thought in ways that would be considered significant by, say, an applied mathematician.
The thesis is that the advantages of executability and universality found in programming languages can be effectively combined, in a single coherent language, with the advantages offered by mathematical notation. it is important to distinguish the difficulty of describing and of learning a piece of notation from the difficulty of mastering its implications. For example, learning the rules for computing a matrix product is easy, but a mastery of its implications (such as its associativity, its distributivity over addition, and its ability to represent linear functions and geometric operations) is a different and much more difficult matter.
Line 48:
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.
An array language simplifies programming but possibly at a cost known as the ''abstraction penalty''.<ref>{{cite thesis|author=Surana P |title=Meta-Compilation of Language Abstractions. |year=2006 |url=https://dl.acm.org/doi/book/10.5555/1195058}}</ref><ref>{{cite web |last= Kuketayev |title= The Data Abstraction Penalty (DAP) Benchmark for Small Objects in Java. |url= http://www.adtmag.com/joop/article.aspx?id=4597 |access-date= 2008-03-17 |archive-url= https://web.archive.org/web/20090111091710/http://www.adtmag.com/joop/article.aspx?id=4597 |archive-date= 2009-01-11 |url-status= dead }}</ref><ref>{{Cite book |
====Ada====
|