Backwards compatibility: Difference between revisions

Jump to navigation Jump to search
Add scope section and move error message discussion there
(→‎Dialects: APL2's precedence change is the exception that proves the rule; it's pretty compatible and doesn't belong on the second list)
(Add scope section and move error message discussion there)
Line 2: Line 2:


APL dialects that emphasize backward compatibility typically apply greater caution when designing features in order to preserve the possibility for extension in the future, and may even consider [[wikipedia:forward compatibility|forward compatibility]]—the ability for an older system to work, or fail safely, with newer features—when designing. Features designed with less care in the past may cause language inconsistencies in the future indefinitely. For example, [[Membership]]'s behavior on high-rank arrays is incompatible with and less useful than other [[high-rank set functions]], but extending it in the new way would break too much existing code for commercial APLs to consider it.
APL dialects that emphasize backward compatibility typically apply greater caution when designing features in order to preserve the possibility for extension in the future, and may even consider [[wikipedia:forward compatibility|forward compatibility]]—the ability for an older system to work, or fail safely, with newer features—when designing. Features designed with less care in the past may cause language inconsistencies in the future indefinitely. For example, [[Membership]]'s behavior on high-rank arrays is incompatible with and less useful than other [[high-rank set functions]], but extending it in the new way would break too much existing code for commercial APLs to consider it.
== Scope ==
Different features in an APL implementation are usually subject to different levels of backwards compatibility constraint. The results of primitives, and the meaning of syntax, are always considered the most important to maintain, while [[system function]]s are often handled more loosely and [[I-beam]]s or [[user command]]s may have very low backwards compatibility requirements.
The specific [[error message]]s produced by any given error is considered less important keep constant. The standards indeed leave it up to the implementations too decide the order in which various aspects of code validity is checked. For example <source lang=apl inline>'ABC'×1 2 3 4</source> could be a [[LENGTH ERROR]] (3 vs. 4 elements) or a [[DOMAIN ERROR]] (attempting to multiply characters). Implementations are known to change the precedence of such errors.
Errors can disappear altogether when the domains of [[primitive]]s are extended, or additional syntax is added. For example, it is common practice to insert a deliberate error into a function, in order to force execution to halt, and the tracing interface to appear. The traditional way to do so was to insert a line with one a function on it. The [[FinnAPL idiom library]] includes
:{|class=wikitable style="background-color: #EBEBEB"
|rowspan=2| 738. || Syntax error to stop execution ||style="text-align: right;"|<source lang=apl inline></source>
|-
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>*</source>
|}
but this will simply print <source lang=apl inline>*</source> in dialects that [[Tacit_programming#Primitives|allow primitive functions to be named]]. Another common phrase was <source lang=apl inline>***</source> as this is easy to search for while being exceedingly unlikely to appear in code. However, with the adoption of [[train]]s, this too became valid, and is likely to print verbatim rather than stop execution. [[APLcart]] includes <source lang=apl inline>...</source> for the same purpose, relying on the continued prohibition against immediately adjacent [[dyadic operator]]s other than for [[outer product]] (<source lang=apl inline>∘.g</source>).


== Dialects ==
== Dialects ==
Line 27: Line 41:


Of these, [[J]] has built a large enough user base to develop its own backwards compatibility concerns, even though early J design was fairly loose with respect to backwards compatibility. Beginning with version 8.07 in 2018 it has removed various features that are considered less important.
Of these, [[J]] has built a large enough user base to develop its own backwards compatibility concerns, even though early J design was fairly loose with respect to backwards compatibility. Beginning with version 8.07 in 2018 it has removed various features that are considered less important.
The specific [[error message]]s produced by any given error is considered less important keep constant. The standards indeed leave it up to the implementations too decide the order in which various aspects of code validity is checked. For example <source lang=apl inline>'ABC'×1 2 3 4</source> could be a [[LENGTH ERROR]] (3 vs. 4 elements) or a [[DOMAIN ERROR]] (attempting to multiply characters). Implementations are known to change the precedence of such errors.
Errors can disappear altogether when the domains of [[primitive]]s are extended, or additional syntax is added. For example, it is common practice to insert a deliberate error into a function, in order to force execution to halt, and the tracing interface to appear. The traditional way to do so was to insert a line with one a function on it. The [[FinnAPL idiom library]] includes
:{|class=wikitable style="background-color: #EBEBEB"
|rowspan=2| 738. || Syntax error to stop execution ||style="text-align: right;"|<source lang=apl inline></source>
|-
|colspan=2 style="background-color: #F5F5F5"|<source lang=apl inline>*</source>
|}
but this will simply print <source lang=apl inline>*</source> in dialects that [[Tacit_programming#Primitives|allow primitive functions to be named]]. Another common phrase was <source lang=apl inline>***</source> as this is easy to search for while being exceedingly unlikely to appear in code. However, with the adoption of [[train]]s, this too became valid, and is likely to print verbatim rather than stop execution. [[APLcart]] includes <source lang=apl inline>...</source> for the same purpose, relying on the continued prohibition against immediately adjacent [[dyadic operator]]s other than for [[outer product]] (<source lang=apl inline>∘.g</source>).


Newer and less commercial APLs such as [[APL\iv]], [[April]], or [[ngn/apl]] tend to be less focused on backwards compatibility than historical ones. These dialects tend to take most design choices from a well-known APL such as [[Dyalog APL]] or [[GNU APL]], but make small breaks for experimentation or address particular issues. They typically do not support features that were historically important but are now rarely used, such as [[shared variables]] or [[Branch]], and may discard features that are still in use but have an adequate replacement, for example removing [[tradfn]]s in favor of [[dfn]]s.
Newer and less commercial APLs such as [[APL\iv]], [[April]], or [[ngn/apl]] tend to be less focused on backwards compatibility than historical ones. These dialects tend to take most design choices from a well-known APL such as [[Dyalog APL]] or [[GNU APL]], but make small breaks for experimentation or address particular issues. They typically do not support features that were historically important but are now rarely used, such as [[shared variables]] or [[Branch]], and may discard features that are still in use but have an adequate replacement, for example removing [[tradfn]]s in favor of [[dfn]]s.

Navigation menu