NARS: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
(Tables of new functionality)
mNo edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 2: Line 2:
| array model              = [[nested array model|nested]]
| array model              = [[nested array model|nested]]
| index origin            = 0 or 1
| index origin            = 0 or 1
| function styles          = [[defined function]]s, [[direct definition (NARS)]]
| function styles          = [[defined function]]s, [[direct definition (operator)]]
| numeric types            =  
| numeric types            =  
| unicode support          = no
| unicode support          = no
Line 12: Line 12:
| operating systems        =  
| operating systems        =  
| documentation            = [http://www.sudleyplace.com/APL/Nested%20Arrays%20System.pdf Reference manual]
| documentation            = [http://www.sudleyplace.com/APL/Nested%20Arrays%20System.pdf Reference manual]
| influenced by            = [[APL*PLUS]], [[Iverson notation]]
| influenced by            = [[APL*PLUS]], [[Operators and Functions]], [[Iverson notation]]
| influenced              = [[Dyalog APL]], [[APL2]], [[NARS2000]]
| influenced              = [[Dyalog APL]], [[APL2]], [[NARS2000]]
}}
}}


[[STSC]]'s '''APL*PLUS Nested Arrays System''' (acronymized '''NARS''', from "Nested Array Research System") was the first commercial [[Nested array model|nested]] APL implementation. Drawing on work by [[Jim Brown]], [[Trenchard More]], and development manager [[Bob Smith]], NARS introduced a new set of functions for working with arrays that contain arrays, as well as many new operators such as [[Power (operator)|Power]].<ref name="manual">Carl M. Cheney. ''[http://www.sudleyplace.com/APL/Nested%20Arrays%20System.pdf APL*PLUS Nested Arrays System]'' (reference manual). [[STSC]]. 1981.</ref>
[[STSC]]'s '''APL*PLUS Nested Arrays System''' (acronymized '''NARS''', from "Nested Array Research System") was the first commercial [[Nested array model|nested]] APL implementation. Drawing on work by [[Jim Brown]], [[Trenchard More]], and development manager [[Bob Smith]], NARS introduced a new set of functions for working with arrays that contain arrays, as well as many new operators such as [[Power (operator)|Power]].<ref name="manual">Carl M. Cheney. ''[http://www.sudleyplace.com/APL/Nested%20Arrays%20System.pdf APL*PLUS Nested Arrays System]'' (reference manual). [[STSC]]. 1981.</ref> It was heavily influenced by [[Ken Iverson]]'s 1978 paper [[Operators and Functions]], and as a result features the first implementations of many primitives that were later added to [[SHARP APL]] and [[J]] under Iverson's direct supervision.


== Primitives ==
== Primitives ==


NARS was an extension of [[APL*PLUS]], which used the [[APL.SV]] primitive set, except for [[Execute]] (<source lang=apl inline>⍎</source>). Only new primitives are shown here, with existing cases in parentheses.
NARS was an extension of [[APL*PLUS]], which used the [[APL.SV]] primitive set, except for [[Execute]] (<syntaxhighlight lang=apl inline>⍎</syntaxhighlight>). Only new primitives are shown here, with existing cases in parentheses.


=== Functions ===
=== Functions ===
Line 27: Line 27:
! Glyph                              !! Monadic              !! Dyadic
! Glyph                              !! Monadic              !! Dyadic
|-
|-
| <source lang=apl inline>⊂</source> || [[Enclose]]          || [[Partitioned Enclose]]
| <syntaxhighlight lang=apl inline>⊂</syntaxhighlight> || [[Enclose]]          || [[Partitioned Enclose]]
|-
|-
| <source lang=apl inline>⊃</source> || Disclose or [[First]] || [[Pick]]
| <syntaxhighlight lang=apl inline>⊃</syntaxhighlight> || Disclose or [[First]] || [[Pick]]
|-
|-
| <source lang=apl inline>⊤</source> || [[Type]]              ||
| <syntaxhighlight lang=apl inline>⊤</syntaxhighlight> || [[Type]]              ||
|-
|-
| <source lang=apl inline></source> ||                       || [[Intersection]]
| <syntaxhighlight lang=apl inline></syntaxhighlight> || [[Simple (NARS)]]    || [[Equivalent]]
|-
|-
| <source lang=apl inline></source> || [[Unique]]           || [[Union]]
| <syntaxhighlight lang=apl inline></syntaxhighlight> || [[Not-Simple]]       || [[Inequivalent]]
|-
|-
| <source lang=apl inline>~</source> ||                       || [[Set Difference]]
| <syntaxhighlight lang=apl inline></syntaxhighlight> || [[Split]]            || ([[Drop]])
|-
|-
| <source lang=apl inline></source> ||                       || [[Catenate]] along the First Dimension
| <syntaxhighlight lang=apl inline></syntaxhighlight> || [[Mix]]              || ([[Take]])
|-
|-
| <source lang=apl inline></source> || [[Simple (NARS)]]     || [[Equivalent]]
| <syntaxhighlight lang=apl inline></syntaxhighlight> || [[Unique]]           || [[Union]]
|-
|-
| <source lang=apl inline></source> || [[Not-Simple]]        || [[Inequivalent]]
| <syntaxhighlight lang=apl inline>~</syntaxhighlight> ||                       || [[Set Difference]]
|-
|-
| <source lang=apl inline></source> || [[Split]]            || ([[Drop]])
| <syntaxhighlight lang=apl inline></syntaxhighlight> ||                       || [[Intersection]]
|-
|-
| <source lang=apl inline></source> || [[Mix]]              || ([[Take]])
| <syntaxhighlight lang=apl inline></syntaxhighlight> ||                       || [[Catenate]] along the First Dimension
|}
|}


Line 57: Line 57:
! Syntax                                !! Monadic call              !! Dyadic call
! Syntax                                !! Monadic call              !! Dyadic call
|-
|-
| <source lang=apl inline>f/</source>  || ([[Reduction]])            || Dyadic Reduction ([[Windowed Reduction]])
| <syntaxhighlight lang=apl inline>f/</syntaxhighlight>  || ([[Reduction]])            || Dyadic Reduction ([[Windowed Reduction]])
|-
|-
| <source lang=apl inline>f\</source>  || ([[Scan]])                || Dyadic Scan
| <syntaxhighlight lang=apl inline>f\</syntaxhighlight>  || ([[Scan]])                || Dyadic Scan
|-
|-
| <source lang=apl inline>f¨</source>  ||colspan=2| [[Each]]
| <syntaxhighlight lang=apl inline>f¨</syntaxhighlight>  ||colspan=2| [[Each]]
|-
|-
| <source lang=apl inline>f⍨</source>  ||                            || [[Commute]]
| <syntaxhighlight lang=apl inline>f⍨</syntaxhighlight>  ||                            || [[Commute]]
|-
|-
| <source lang=apl inline>f⍣B</source>  || [[Power (operator)|Power]] ||
| <syntaxhighlight lang=apl inline>f⍣B</syntaxhighlight>  || [[Power (operator)|Power]] ||
|-
|-
| <source lang=apl inline>f⍣∘</source>  || [[Power Limit]]            ||
| <syntaxhighlight lang=apl inline>f⍣∘</syntaxhighlight>  || [[Power Limit]]            ||
|-
|-
| <source lang=apl inline>f⍣∘</source>  || [[Power Series (operator)|Power Series]] ||
| <syntaxhighlight lang=apl inline>f⍣∘</syntaxhighlight>  || [[Power Series (operator)|Power Series]] ||
|-
|-
| <source lang=apl inline>f∘g</source>  ||colspan=2| Composition ([[Beside]])
| <syntaxhighlight lang=apl inline>f∘g</syntaxhighlight>  ||colspan=2| Composition ([[Beside]])
|-
|-
| <source lang=apl inline>A∘g</source>  ||rowspan=2| Composition ([[Bind]])  ||
| <syntaxhighlight lang=apl inline>A∘g</syntaxhighlight>  ||rowspan=2| Composition ([[Bind]])  ||
|-
|-
| <source lang=apl inline>f∘B</source>  ||
| <syntaxhighlight lang=apl inline>f∘B</syntaxhighlight>  ||
|-
|-
| <source lang=apl inline>f⍢g</source>  ||colspan=2| [[Dual]]
| <syntaxhighlight lang=apl inline>f⍢g</syntaxhighlight>  ||colspan=2| [[Dual]]
|-
|-
| <source lang=apl inline>A⍡</source>  ||                           || [[Convolution operator]]
| <syntaxhighlight lang=apl inline>∘.g</syntaxhighlight>  || Function Table            || ([[Outer Product]])
|-
|-
| <source lang=apl inline>A∘/</source> ||                            || [[Mask]]
| <syntaxhighlight lang=apl inline>A⍡</syntaxhighlight> ||                            || [[Convolution operator]]
|-
|-
| <source lang=apl inline>A∘\</source> ||                            || [[Mesh]]
| <syntaxhighlight lang=apl inline>A∘/</syntaxhighlight> ||                            || [[Mask]]
|-
|-
!colspan=3| [[Direct definition (NARS)|Direct definition]]
| <syntaxhighlight lang=apl inline>A∘\</syntaxhighlight> ||                            || [[Mesh]]
|-
|-
| <source lang=apl inline>∘∇B</source> || [[Monadic]]               ||
!colspan=3| [[Direct definition (operator)|Direct definition]]
|-
|-
| <source lang=apl inline>A∇∘</source> ||                            || [[Dyadic]]
| <syntaxhighlight lang=apl inline>∘∇B</syntaxhighlight> || [[Monadic]]               ||
|-
|-
| <source lang=apl inline>A∇B</source> ||colspan=2| [[Ambivalent]]
| <syntaxhighlight lang=apl inline>A∇∘</syntaxhighlight> ||                            || [[Dyadic]]
|-
| <syntaxhighlight lang=apl inline>A∇B</syntaxhighlight> ||colspan=2| [[Ambivalent]]
|}
|}
The [[Outer Product]] operator was renamed "Function Table".


=== Other functionality ===
=== Other functionality ===
Line 100: Line 100:
* [[Stranding]] and [[stranded assignment]] syntax were added.
* [[Stranding]] and [[stranded assignment]] syntax were added.
* The primitive array [[Zilde]] was introduced.
* The primitive array [[Zilde]] was introduced.
* The assignment arrow <source lang=apl inline>←</source> with nothing to the left was used to indicate [[Sink]], which prevented display of a value.
* The assignment arrow <syntaxhighlight lang=apl inline>←</syntaxhighlight> with nothing to the left was used to indicate [[Sink]], which prevented display of a value.
* [[Defined function]]s were extended to allow an ambivalent case.
* [[Defined function]]s were extended to allow an ambivalent case.
* [[Choose indexing]] was added.
* [[Choose indexing]] was added.

Latest revision as of 02:40, 8 March 2024


STSC's APL*PLUS Nested Arrays System (acronymized NARS, from "Nested Array Research System") was the first commercial nested APL implementation. Drawing on work by Jim Brown, Trenchard More, and development manager Bob Smith, NARS introduced a new set of functions for working with arrays that contain arrays, as well as many new operators such as Power.[2] It was heavily influenced by Ken Iverson's 1978 paper Operators and Functions, and as a result features the first implementations of many primitives that were later added to SHARP APL and J under Iverson's direct supervision.

Primitives

NARS was an extension of APL*PLUS, which used the APL.SV primitive set, except for Execute (). Only new primitives are shown here, with existing cases in parentheses.

Functions

Glyph Monadic Dyadic
Enclose Partitioned Enclose
Disclose or First Pick
Type
Simple (NARS) Equivalent
Not-Simple Inequivalent
Split (Drop)
Mix (Take)
Unique Union
~ Set Difference
Intersection
Catenate along the First Dimension

Additionally, Index Generator was extended to allow a vector argument, Replicate and Expand were extended to allow integer left arguments, and Reshape was extended to allow an empty right argument (using fill elements).

Operators

Syntax Monadic call Dyadic call
f/ (Reduction) Dyadic Reduction (Windowed Reduction)
f\ (Scan) Dyadic Scan
Each
f⍨ Commute
f⍣B Power
f⍣∘ Power Limit
f⍣∘ Power Series
f∘g Composition (Beside)
A∘g Composition (Bind)
f∘B
f⍢g Dual
∘.g Function Table (Outer Product)
A⍡ Convolution operator
A∘/ Mask
A∘\ Mesh
Direct definition
∘∇B Monadic
A∇∘ Dyadic
A∇B Ambivalent

Other functionality

References


APL dialects [edit]
Maintained APL+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLDyalog APL Visiondzaima/APLGNU APLKapNARS2000PometoTinyAPL
Historical A Programming LanguageA+ (A) ∙ APL#APL2CAPL\360APL/700APL\1130APL\3000APL.68000APL*PLUSAPL.jlAPL.SVAPLXExtended Dyalog APLIverson notationIVSYS/7090NARSngn/aplopenAPLOperators and FunctionsPATRowanSAXSHARP APLRationalized APLVisualAPL (APLNext) ∙ VS APLYork APL
Derivatives AHPLBQNCoSyELIGleeIIvyJJellyK (Goal, Klong, Q) ∙ KamilaLispLang5LilNialRADUiua
Overviews Comparison of APL dialectsTimeline of array languagesTimeline of influential array languagesFamily tree of array languages