Comparison of APL dialects: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
(Create Comparison of APL dialects page)
 
(Language, navigation box, category)
Line 1: Line 1:
While all APL dialects share a few features, there are important distinctions between them. This page's aim is to document the most significant differences.
All APL dialects share core features, and at least the [[primitive]]s are [[Backwards compatibility|backwards compatible]] with those of [[APL.SV]]. However, there are important dialectal differences, the most significant of which are described in this article.


== Flat vs Nested ==
== Flat versus Nested ==


One of the most significant differences between APLs is the choice of [[Nested array theory|nested]] or [[Flat array theory|flat]] array model. Originally, APLs were flat, that is, the only scalar values supported were simple numbers or characters. SHARP APL introduced [[Box|boxes]] to the flat array model, which allow for arrays to be elements of other arrays. NARS then introduced the nested array model, where nested arrays inside other arrays are more natural to use. Most currently maintained dialects ([[Dyalog APL]], [[NARS2000]], [[APL2]], [[GNU APL]]) now use the nested array model.
One of the most significant differences between APLs is the choice of [[array model]], namely [[Nested array theory|nested]] or [[Flat array theory|flat]]. Originally, all APLs were entirely flat, that is, the only [[scalar]] values supported were [[simple]] and had to be either [[number]]s and [[character]]s, and an array had to be homogeneous, that is, consisting entirely of a single [[type]]. [[SHARP APL]] introduced the [[box]] as a third type, such that a box could hold any other array (including a box array), and this allowed for arrays contain other arrays. [[NARS]] introduced the nested array model, where any arrays can be an actual [[element]] of another array. Most currently maintained dialects ([[Dyalog APL]], [[NARS2000]], [[APL2]], [[GNU APL]], and others) use the nested array model.


== Complex numbers ==
== Complex numbers ==


While most dialects support complex numbers, some ([[dzaima/APL]], [[APLX]], [[APL+Win]]) don't. Usually dialects with complex numbers support also extend [[Circular]] to left arguments designed for complex numbers.
Most dialects support [[complex number]]s, but some ([[dzaima/APL]], [[APLX]], [[APL+Win]]) don't. Dialects with complex numbers also extend [[Circular]] (<syntaxhighlight lang=apl inline>○</syntaxhighlight>) to left arguments designed for complex numbers.


== First/Mix ==
== First/Mix ==


[[Dyalog APL]] and dialects based on it define <syntaxhighlight lang=apl inline></syntaxhighlight> as [[First]] and <syntaxhighlight lang=apl inline></syntaxhighlight> as [[Mix]]. Other dialects ([[NARS2000]], [[APL2]], [[GNU APL]], but also Dyalog with [[Migration level|migration level]] 2 or 3) instead swap the two glyphs' meanings.
In dialects implementing [[nested array theory]], the two [[glyph]]s commonly used for [[Disclose]] are [[Right Shoe]] (<syntaxhighlight lang=apl inline>⊃</syntaxhighlight>) and [[Up Arrow]] (<syntaxhighlight lang=apl inline>↑</syntaxhighlight>). The original [[NARS]] paper specified [[monadic]] <syntaxhighlight lang=apl inline></syntaxhighlight> as [[Mix]] and <syntaxhighlight lang=apl inline></syntaxhighlight> as [[First]], so [[Dyalog]] and [[STSC]] implemented [[Dyalog APL]] and [[APL*PLUS]] accordingly. [[IBM]] decided to swap them in [[APL2]], causing the others to implement [[Migration Level]], as APL2 was seen as the authoritative implementation. When the ISO [[standard]] was written, it closely followed APL2, causing [[APLX]], [[NARS2000]], [[GNU APL]], and [[ngn/apl]] to adopt these notations. However, ngn/apl later switched to follow Dyalog.


== Depth ==
== Depth ==


[[Dyalog APL]] defines [[Depth]] to return negative numbers when the depth isn't even. Most other dialects instead define it to return the maximum depth.
[[Dyalog APL]] defines [[Depth]] (<syntaxhighlight lang=apl inline>≡</syntaxhighlight>) to return negative numbers when the depth is uneven. Most other dialects instead define it to return the maximum depth. The original NARS paper assigned the glyph to a function called [[Simple (NARS)|Simple]], which simply answered if the argument was simple or not, without reporting the actual depth. It was thus equivalent to today's <syntaxhighlight lang=apl inline>1=≡,Y</syntaxhighlight>.


== Omnibar ==
== External links ==
 
* [https://omnibar.rubenverg.com Omnibar] is a site that lists all available glyphs in a variety of dialects together with their meanings. It supports filtering using set operations (union, intersection, difference) between feature sets of the supported dialects.
[https://omnibar.rubenverg.com Omnibar] is a site that lists all available glyphs in the supported dialects and indicates what meanings (primitives) are available in each dialect. It supports search based on the meanings available for each dialect using set operations (union, intersection, difference).
{{APL dialects}}[[Category:Lists]]

Revision as of 12:58, 15 February 2024

All APL dialects share core features, and at least the primitives are backwards compatible with those of APL.SV. However, there are important dialectal differences, the most significant of which are described in this article.

Flat versus Nested

One of the most significant differences between APLs is the choice of array model, namely nested or flat. Originally, all APLs were entirely flat, that is, the only scalar values supported were simple and had to be either numbers and characters, and an array had to be homogeneous, that is, consisting entirely of a single type. SHARP APL introduced the box as a third type, such that a box could hold any other array (including a box array), and this allowed for arrays contain other arrays. NARS introduced the nested array model, where any arrays can be an actual element of another array. Most currently maintained dialects (Dyalog APL, NARS2000, APL2, GNU APL, and others) use the nested array model.

Complex numbers

Most dialects support complex numbers, but some (dzaima/APL, APLX, APL+Win) don't. Dialects with complex numbers also extend Circular () to left arguments designed for complex numbers.

First/Mix

In dialects implementing nested array theory, the two glyphs commonly used for Disclose are Right Shoe () and Up Arrow (). The original NARS paper specified monadic as Mix and as First, so Dyalog and STSC implemented Dyalog APL and APL*PLUS accordingly. IBM decided to swap them in APL2, causing the others to implement Migration Level, as APL2 was seen as the authoritative implementation. When the ISO standard was written, it closely followed APL2, causing APLX, NARS2000, GNU APL, and ngn/apl to adopt these notations. However, ngn/apl later switched to follow Dyalog.

Depth

Dyalog APL defines Depth () to return negative numbers when the depth is uneven. Most other dialects instead define it to return the maximum depth. The original NARS paper assigned the glyph to a function called Simple, which simply answered if the argument was simple or not, without reporting the actual depth. It was thus equivalent to today's 1=≡,Y.

External links

  • Omnibar is a site that lists all available glyphs in a variety of dialects together with their meanings. It supports filtering using set operations (union, intersection, difference) between feature sets of the supported dialects.
APL dialects [edit]
Maintained APL+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLDyalog APL Visiondzaima/APLGNU APLKapNARS2000Pometo
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