NARS2000
NARS2000 is an open-source APL interpreter written by Bob Smith, a prominent APL developer and implementer from STSC in the 1970s and 1980s. NARS2000 contains advanced features and new datatypes and runs natively on Microsoft Windows, and other platforms under Wine. It is the spiritual successor of the first NARS (Nested Arrays Research System) which was designed and implemented in the early 1980s as a testbed for new ideas in APL, principally with nested arrays.
Language ideas include new functions, operators, datatypes, and many other extensions. The project is free open source software.
Primitives
The following list is incomplete.
Functions
One feature of NARS2000 is its heavy use of experimental primitive functions & operators. In the table below, symbols which are unknown or obscure in the APL world are linked to the NARS2000 wiki rather than the APL wiki.
Glyph | Monadic | Dyadic |
---|---|---|
<syntaxhighlight lang=apl inline>⍸</source> | Indices | Array Lookup (high-rank Index-Of) |
<syntaxhighlight lang=apl inline><</source> | Condense | Less Than |
<syntaxhighlight lang=apl inline>></source> | Dilate | Greater Than |
<syntaxhighlight lang=apl inline>\</source> | Expand | |
<syntaxhighlight lang=apl inline>⍷</source> | Find | |
<syntaxhighlight lang=apl inline>⍳</source> | Index Generator | Index Of |
<syntaxhighlight lang=apl inline>⌹</source> | Matrix Inverse | Matrix Divide |
<syntaxhighlight lang=apl inline>≢</source> | Tally | Mismatch |
<syntaxhighlight lang=apl inline>⊂</source> | Partitioned Enclose | |
<syntaxhighlight lang=apl inline>π</source> | Prime Factors | Number Theory |
<syntaxhighlight lang=apl inline>⍴</source> | Shape | Reshape |
<syntaxhighlight lang=apl inline>√</source> | Square Root | Root |
<syntaxhighlight lang=apl inline>..</source> | Sequence | |
<syntaxhighlight lang=apl inline>⊆</source> | Subset | |
<syntaxhighlight lang=apl inline>⊇</source> | Superset | |
<syntaxhighlight lang=apl inline>§</source> | Symmetric Difference | |
<syntaxhighlight lang=apl inline>~</source> | Not | Without |
<syntaxhighlight lang=apl inline>≤</source> | Contract | Less Than or Equal |
<syntaxhighlight lang=apl inline>≥</source> | Distract | Greater Than or Equal |
Operators
Glyph | Valence | Monadic call | Dyadic call |
---|---|---|---|
<syntaxhighlight lang=apl inline>⍣</source> | Dyadic | Power | |
<syntaxhighlight lang=apl inline>⍨</source> | Monadic | Duplicate | Commute |
<syntaxhighlight lang=apl inline>⍥</source> | Dyadic | Composition (Over) | |
<syntaxhighlight lang=apl inline>∘</source> | Dyadic | Compose | |
<syntaxhighlight lang=apl inline>⍤</source> | Dyadic | Rank | |
<syntaxhighlight lang=apl inline>‼</source> | Monadic | Combinatorial | |
<syntaxhighlight lang=apl inline>⍡</source> | Dyadic | Convolution | |
<syntaxhighlight lang=apl inline>.</source> | Dyadic | Determinant | Inner Product |
<syntaxhighlight lang=apl inline>∂</source> | Monadic | Numerical (Partial) Derivative | |
<syntaxhighlight lang=apl inline>∫</source> | Monadic | Numerical Integral | |
<syntaxhighlight lang=apl inline>⌻</source> | Monadic | Matrix | |
<syntaxhighlight lang=apl inline>⍦</source> | Monadic | Multisets | |
<syntaxhighlight lang=apl inline>⊙</source> | Monadic | Null | |
<syntaxhighlight lang=apl inline>a∘/</source> | Special | Mask | |
<syntaxhighlight lang=apl inline>a∘⌿</source> | Special | Mask First | |
<syntaxhighlight lang=apl inline>a∘\</source> | Special | Mesh | |
<syntaxhighlight lang=apl inline>a∘⍀</source> | Special | Mesh First | |
<syntaxhighlight lang=apl inline>⍠</source> | Dyadic | Variant | |
<syntaxhighlight lang=apl inline>≈</source> | Monadic | Ball Arithmetic |
Datatypes
Along with the Real numbers, NARS2000 supports the rest of the four Normed Division Algebra datatypes: Complex, Quaternion, and Octonion numbers, along with several Multi-Precision datatypes, and signed Infinities:
Notation | Datatype |
---|---|
<syntaxhighlight lang=apl inline>1i2</source> | Complex |
<syntaxhighlight lang=apl inline>1i2j3k4</source> | Quaternion |
<syntaxhighlight lang=apl inline>1i2j3k4l5ij6jk7kl8</source> | Octonion |
<syntaxhighlight lang=apl inline>2.2x</source> | Rational Numbers |
<syntaxhighlight lang=apl inline>2.2v</source> | Variable-precision Floating Point Numbers |
<syntaxhighlight lang=apl inline>2.2±</source> | Ball Arithmetic |
<syntaxhighlight lang=apl inline>∞ and ¯∞</source> | Signed Infinities |
<syntaxhighlight lang=apl inline>∅</source> | Not-a-Number (NaN) |
Each of the 2, 4, or 8 coefficients of Hypercomplex numbers must all be the same Real number datatype (i.e., Boolean, Integer, Floating Point, Rational, Variable-precision Floating Point, or Ball Arithmetic), or else they will all be promoted to a single common Real number datatype.
External links
APL dialects [edit] | |
---|---|
Maintained | APL+Win ∙ APL2 ∙ APL64 ∙ APL\iv ∙ Aplette ∙ April ∙ Co-dfns ∙ Dyalog APL ∙ Dyalog APL Vision ∙ dzaima/APL ∙ GNU APL ∙ Kap ∙ NARS2000 ∙ Pometo ∙ TinyAPL |
Historical | A Programming Language ∙ A+ (A) ∙ APL# ∙ APL2C ∙ APL\360 ∙ APL/700 ∙ APL\1130 ∙ APL\3000 ∙ APL.68000 ∙ APL*PLUS ∙ APL.jl ∙ APL.SV ∙ APLX ∙ Extended Dyalog APL ∙ Iverson notation ∙ IVSYS/7090 ∙ NARS ∙ ngn/apl ∙ openAPL ∙ Operators and Functions ∙ PAT ∙ Rowan ∙ SAX ∙ SHARP APL ∙ Rationalized APL ∙ VisualAPL (APLNext) ∙ VS APL ∙ York APL |
Derivatives | AHPL ∙ BQN ∙ CoSy ∙ ELI ∙ Glee ∙ I ∙ Ivy ∙ J ∙ Jelly ∙ K (Goal, Klong, Q) ∙ KamilaLisp ∙ Lang5 ∙ Lil ∙ Nial ∙ RAD ∙ Uiua |
Overviews | Comparison of APL dialects ∙ Timeline of array languages ∙ Timeline of influential array languages ∙ Family tree of array languages |