NARS2000: Difference between revisions

Jump to navigation Jump to search
4,363 bytes added ,  18:57, 14 September 2022
no edit summary
Miraheze>Adám Brudzewsky
No edit summary
(21 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{Infobox array language
{{Infobox array language
| logo                    = [[File:Nars2000.png]]
| array model              = [[nested array model|nested]]
| array model              = [[nested array model|nested]]
| index origin            = 0 or 1
| index origin            = 0 or 1
| function styles          = [[tradfn]], [[dfn]], [[tacit]]
| function styles          = [[tradfn]], [[dfn]], [[tacit]]
| numeric types            = complex floats, quaternion, octonion, [[rational]], ball arithmetic, variable precision float, infinite precision
| numeric types            = [[complex]] floats, quaternion, octonion, [[rational]], ball arithmetic, variable precision float, infinite precision
| unicode support          = partial (UCS-2)
| unicode support          = partial (UCS-2)
| released                = 2006
| released                = 2006
| developer                = [[Sudley Place Software]]
| developer                = Sudley Place Software ([[Bob Smith]])
| latest release version  = 0.5 / 2019
| latest release version  = 0.5 / 2019
| implementation languages = [https://en.wikipedia.org/wiki/C_(programming_language) C], APL
| implementation languages = [[wikipedia:C (programming language)|C]], APL
| source                  = [https://sourceforge.net/p/nars2000/code/HEAD/tree/branches/bsmith/NewTypes/ SourceForge]
| platforms                = x86, x86_64
| platforms                = x86, x86_64
| operating systems        = Windows, Linux (via Wine), macOS (via Wine)
| operating systems        = Windows, Linux (via Wine), macOS (via Wine)
| license                  = [https://en.wikipedia.org/wiki/GNU_General_Public_License GNU GPL]
| license                  = [[wikipedia:GNU General Public License|GNU GPL]]
| website                  = [http://www.nars2000.org/ nars2000.org]
| website                  = [http://www.nars2000.org/ nars2000.org]
| download                = [http://www.nars2000.org/download/ nars2000.org/download]
| download                = [http://www.nars2000.org/download/ nars2000.org/download]
| forum                    = [https://www.tapatalk.com/groups/nars2000/ NARS2000 Forum]
| file ext                = .dws, .dse, .dcf, .dyalog, .dyapp, .apl, .apla, .aplf, .aplo, .apln, .aplc, .apli
| file ext                = .dws, .dse, .dcf, .dyalog, .dyapp, .apl, .apla, .aplf, .aplo, .apln, .aplc, .apli
| documentation            = [http://wiki.nars2000.org/ NARS2000 Wiki]
| documentation            = [http://wiki.nars2000.org/ NARS2000 Wiki]
| influenced by            = [[APL2]], [[J]], [[SHARP APL]], [[Dyalog APL]]
| influenced by            = [[NARS]], [[APL2]], [[J]], [[SHARP APL]], [[Dyalog APL]]
| influenced              = [[Dyalog APL]]
| influenced              = [[Dyalog APL]]
}}
}}


'''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|Simple scalars]] 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.
'''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 [[datatype]]s 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 extensiosn. The  project is free open source software.
Language ideas include new functions, operators, datatypes, and many other extensions. The  project is free open source software.


== Primitives ==
== Primitives ==
Line 29: Line 33:


=== Functions ===
=== 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.


{| class=wikitable
{| class=wikitable
! Glyph                              !! Monadic            !! Dyadic
! Glyph                              !! Monadic            !! Dyadic
|-
|-
| <source lang=apl inline>⍸</source>  || [[Indices]]        || Array Lookup (high-rank [[Index-Of]])
| <syntaxhighlight lang=apl inline>⍸</syntaxhighlight>  || [[Indices]]        || Array Lookup (high-rank [[Index-Of]])
|-
| <syntaxhighlight lang=apl inline><</syntaxhighlight>  || [http://wiki.nars2000.org/index.php?title=Condense Condense] || [[Less Than]]
|-
| <syntaxhighlight lang=apl inline>></syntaxhighlight>  || [http://wiki.nars2000.org/index.php?title=Dilate Dilate]    || [[Greater Than]]
|-
|-
| <source lang=apl inline><</source>  || [[Condense]]        || [[Less Than]]
| <syntaxhighlight lang=apl inline>\</syntaxhighlight>  ||                     || [[Expand]]
|-
|-
| <source lang=apl inline>></source>  || [[Dilate]]          || [[Greater Than]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  ||                     || [[Find]]
|-
|-
| <source lang=apl inline>\</source>  ||                     || [[Expand]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || [[Index Generator]] || [[Index Of]]
|-
|-
| <source lang=apl inline></source>  ||                     || [[Find]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || [[Matrix Inverse]]  || [[Matrix Divide]]
|-
|-
| <source lang=apl inline></source>  || [[Index Generator]] || [[Index Of]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || [[Tally]]           || [[Not Match|Mismatch]]
|-
|-
| <source lang=apl inline></source>  || [[Matrix Inverse]]  || [[Matrix Divide]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  ||                     || [[Partitioned Enclose]]
|-
|-
| <source lang=apl inline></source>  || [[Tally]]          || [[Not Match|Mismatch]]
| <syntaxhighlight lang=apl inline>π</syntaxhighlight>  || [http://wiki.nars2000.org/index.php?title=Primes Prime Factors] || [http://wiki.nars2000.org/index.php?title=Primes Number Theory]
|-
|-
| <source lang=apl inline></source>  ||                     || [[Partitioned Enclose]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || [[Shape]]          || [[Reshape]]
|-
|-
| <source lang=apl inline>π</source>  || [[Factors]]         || [[Primes]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || [[Square Root]]     || [[Root]]
|-
|-
| <source lang=apl inline></source> || [[Shape]]          || [[Reshape]]
| <syntaxhighlight lang=apl inline>..</syntaxhighlight> ||                     || [http://wiki.nars2000.org/index.php?title=Sequence Sequence]
|-
|-
| <source lang=apl inline></source>  || [[Square Root]]    || [[Root]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  ||                     || [http://wiki.nars2000.org/index.php?title=Sets#subset Subset]
|-
|-
| <source lang=apl inline>..</source> ||                    || [[Sequence]]
| <syntaxhighlight lang=apl inline></syntaxhighlight> ||                    || [http://wiki.nars2000.org/index.php?title=Sets#superset Superset]
|-
|-
| <source lang=apl inline></source>  ||                    || [[Subset]]
| <syntaxhighlight lang=apl inline>§</syntaxhighlight>  ||                    || [http://wiki.nars2000.org/index.php?title=Sets#symmetric_difference Symmetric Difference]
|-
|-
| <source lang=apl inline></source>  ||                     || [[Superset]]
| <syntaxhighlight lang=apl inline>~</syntaxhighlight>  || [[Not]]            || [[Without]]
|-
|-
| <source lang=apl inline>§</source>  ||                     || [[Symmetric Difference]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || [http://wiki.nars2000.org/index.php?title=Ball_Arithmetic#Contract Contract] || [[Less Than or Equal]]
|-
|-
| <source lang=apl inline>~</source>  || [[Not]]             || [[Without]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || [http://wiki.nars2000.org/index.php?title=Ball_Arithmetic#Distract Distract] || [[Greater Than or Equal]]
|}
|}


=== Operators ===
=== Operators ===
One feature of NARS2000 is its heavy use of experimental primitive operators. In the table below, operators which are unknown or obscure in the APL world are linked to the NARS2000 wiki rather than the APL wiki.


{| class=wikitable
{| class=wikitable
! Glyph                                !! Valence !! Monadic call      !! Dyadic call
! Glyph                                !! Valence !! Monadic call      !! Dyadic call
|-
|-
| <source lang=apl inline>⍣</source>  || Dyadic  ||colspan=2| [[Power operator|Power]]
| <syntaxhighlight lang=apl inline>⍣</syntaxhighlight>  || Dyadic  ||colspan=2| [http://wiki.nars2000.org/index.php?title=Power Power]
|-
| <syntaxhighlight lang=apl inline>⍨</syntaxhighlight>  || Monadic || [http://wiki.nars2000.org/index.php?title=Commute-Duplicate Duplicate] || [http://wiki.nars2000.org/index.php?title=Commute-Duplicate Commute]
|-
| <syntaxhighlight lang=apl inline>⍥</syntaxhighlight>  || Dyadic  ||colspan=2| Composition ([[Over]])
|-
| <syntaxhighlight lang=apl inline>∘</syntaxhighlight>  || Dyadic  ||colspan=2| [[Compose]]
|-
| <syntaxhighlight lang=apl inline>⍤</syntaxhighlight>  || Dyadic  ||colspan=2| [[Rank operator|Rank]]
|-
| <syntaxhighlight lang=apl inline>‼</syntaxhighlight>  || Monadic || [http://wiki.nars2000.org/index.php/Combinatorial Combinatorial] ||
|-
| <syntaxhighlight lang=apl inline>⍡</syntaxhighlight>  || Dyadic  ||                  || [http://wiki.nars2000.org/index.php?title=Convolution Convolution]
|-
| <syntaxhighlight lang=apl inline>.</syntaxhighlight>  || Dyadic  || [http://wiki.nars2000.org/index.php?title=Determinant_Operator Determinant] || [[Inner Product]]
|-
|-
| <source lang=apl inline></source>  || Monadic ||colspan=2| [[Commute]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || Monadic ||colspan=2| Numerical (Partial) [http://wiki.nars2000.org/index.php/Derivative Derivative]
|-
|-
| <source lang=apl inline></source>  || Dyadic  ||colspan=2| Composition ([[Over]])
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || Monadic ||colspan=2| Numerical [http://wiki.nars2000.org/index.php/Integral Integral]
|-
| <syntaxhighlight lang=apl inline>⌻</syntaxhighlight>  || Monadic ||colspan=2| [http://wiki.nars2000.org/index.php/Matrix Matrix]
|-
|-
| <source lang=apl inline></source>  || Dyadic  ||colspan=2| [[Compose]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || Monadic ||colspan=2| [http://wiki.nars2000.org/index.php/Multisets Multisets]
|-
|-
| <source lang=apl inline></source>  || Dyadic  ||colspan=2| [[Rank operator|Rank]]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || Monadic ||colspan=2| [http://wiki.nars2000.org/index.php/Null Null]
|-
|-
| <source lang=apl inline></source>   || Monadic || [http://wiki.nars2000.org/index.php/Combinatorial Combinatorial] ||
| <syntaxhighlight lang=apl inline>a∘/</syntaxhighlight> || Special ||                  || [http://wiki.nars2000.org/index.php?title=Compose#Mask Mask]
|-
|-
| <source lang=apl inline></source>   || Dyadic  ||                   || [[Convolution]]
| <syntaxhighlight lang=apl inline>a∘⌿</syntaxhighlight> || Special ||                 || [http://wiki.nars2000.org/index.php?title=Compose#Mask Mask] First
|-
|-
| <source lang=apl inline>.</source>   || Dyadic  || [[Inner Product]] || [[Alternant]]
| <syntaxhighlight lang=apl inline>a∘\</syntaxhighlight> || Special ||                 || [[Mesh]]
|-
|-
| <source lang=apl inline></source>   || Monadic ||colspan=2| Numerical [http://wiki.nars2000.org/index.php/Derivative Derivative]
| <syntaxhighlight lang=apl inline>a∘⍀</syntaxhighlight> || Special ||                 || [[Mesh]] First
|-
|-
| <source lang=apl inline></source>  || Monadic ||colspan=2| [http://wiki.nars2000.org/index.php/Matrix Matrix]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || Dyadic  ||colspan=2| [http://wiki.nars2000.org/index.php?title=Variant Variant]
|-
|-
| <source lang=apl inline></source>  || Monadic ||colspan=2| [http://wiki.nars2000.org/index.php/Multisets Multisets]
| <syntaxhighlight lang=apl inline></syntaxhighlight>  || Monadic ||colspan=2| [http://wiki.nars2000.org/index.php?title=Ball_Arithmetic Ball Arithmetic]
|}
 
== Datatypes ==
 
Along with the Real numbers, NARS2000 supports the rest of the four [https://en.wikipedia.org/wiki/Hurwitz%27s_theorem_(composition_algebras) Normed Division Algebra] datatypes:  Complex, Quaternion, and Octonion numbers, along with several Multi-Precision datatypes, and signed Infinities:
 
{| class=wikitable
! Notation !! Datatype
|-
|-
| <source lang=apl inline></source>   || Monadic ||colspan=2| [http://wiki.nars2000.org/index.php/Null Null]
| <syntaxhighlight lang=apl inline>1i2</syntaxhighlight> || [http://www.sudleyplace.com/APL/Hypercomplex%20Numbers%20in%20APL.pdf Complex]
|-
|-
| <source lang=apl inline>a∘/</source> || Special ||                  || [[Mask]]
| <syntaxhighlight lang=apl inline>1i2j3k4</syntaxhighlight> || [http://www.sudleyplace.com/APL/Hypercomplex%20Numbers%20in%20APL.pdf Quaternion]
|-
|-
| <source lang=apl inline>a∘⌿</source> || Special ||                  || [[Mask]] First
| <syntaxhighlight lang=apl inline>1i2j3k4l5ij6jk7kl8</syntaxhighlight> || [http://www.sudleyplace.com/APL/Hypercomplex%20Numbers%20in%20APL.pdf Octonion]
|-
|-
| <source lang=apl inline>a∘\</source> || Special ||                  || [[Mesh]]
| <syntaxhighlight lang=apl inline>2.2x</syntaxhighlight> || [http://wiki.nars2000.org/index.php?title=Rational_and_VFP_Numbers Rational Numbers]
|-
|-
| <source lang=apl inline>a∘⍀</source> || Special ||                  || [[Mesh]] First
| <syntaxhighlight lang=apl inline>2.2v</syntaxhighlight> || [http://wiki.nars2000.org/index.php?title=Rational_and_VFP_Numbers Variable-precision Floating Point Numbers]
|-
|-
| <source lang=apl inline></source>   || Dyadic  ||colspan=2| [[Variant]]
| <syntaxhighlight lang=apl inline>2.2±</syntaxhighlight> || [http://wiki.nars2000.org/index.php?title=Ball_Arithmetic Ball Arithmetic]
|-
| <syntaxhighlight lang=apl inline>∞ and ¯∞</syntaxhighlight> || [http://wiki.nars2000.org/index.php?title=Infinity Signed Infinities]
|-
| <syntaxhighlight lang=apl inline>∅</syntaxhighlight> || [http://wiki.nars2000.org/index.php?title=NaN 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.
== Syntax ==
* [http://wiki.nars2000.org/index.php?title=Hyperators Hyperators]


== External links ==
== External links ==
Line 115: Line 157:
* [http://wiki.nars2000.org/ Wiki]
* [http://wiki.nars2000.org/ Wiki]


{{APL programming language}}
{{APL dialects}}[[Category:APL dialects]][[Category:Nested array languages]][[Category:Leading axis languages]][[Category:Languages with tacit programming]]
2

edits

Navigation menu