Ngn/apl: Difference between revisions
Jump to navigation
Jump to search
m (Typo) |
(Link removed) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 18: | Line 18: | ||
| run online = [https://abrudz.github.io/ngn-apl/web/ In-browser] | | run online = [https://abrudz.github.io/ngn-apl/web/ In-browser] | ||
}} | }} | ||
'''ngn/apl''' is an APL bytecode compiler and interpreter by | '''ngn/apl''' is an APL bytecode compiler and interpreter by Nick Nickolov. Because it is implemented in [[wikipedia:Javascript|Javascript]], it can be run in [[wikipedia:Node.js|Node.js]] or any modern browser. | ||
On December 27, 2020, Nickolov announced that he would discard his implementation.<ref>Nickolov, N. "ngn". [https://chat.stackexchange.com/transcript/message/56558504#56558504 Announcement]. [[APL Orchard]]. Stack Exchange chat.</ref> Soon after, [[Adám Brudzewsky]] took up the mantle of hosting the source and online demo.<ref>Brudzewsky, A. "Adám". [https://chat.stackexchange.com/transcript/message/56558600#56558600 Announcement]. [[APL Orchard]]. Stack Exchange chat.</ref> | On December 27, 2020, Nickolov announced that he would discard his implementation.<ref>Nickolov, N. "ngn". [https://chat.stackexchange.com/transcript/message/56558504#56558504 Announcement]. [[APL Orchard]]. Stack Exchange chat.</ref> Soon after, [[Adám Brudzewsky]] took up the mantle of hosting the source and online demo.<ref>Brudzewsky, A. "Adám". [https://chat.stackexchange.com/transcript/message/56558600#56558600 Announcement]. [[APL Orchard]]. Stack Exchange chat.</ref> | ||
[[File:Ngn/apl|center|thumb|ngn/apl's [https://abrudz.github.io/ngn-apl/web/ demo interface]]] | [[File:Ngn/apl|center|thumb|ngn/apl's [https://abrudz.github.io/ngn-apl/web/ demo interface]]] | ||
== External | |||
== Features == | |||
ngn/apl partially supports some of the core language of [[Dyalog APL 14.0]]: | |||
* [[dfn]]s (<syntaxhighlight lang=apl inline>{⍺ ⍵}</syntaxhighlight>) | |||
* [[nested array]]s | |||
* [[complex number]]s (<syntaxhighlight lang=apl inline>1j2</syntaxhighlight>) | |||
* [[Function train|forks and atops]] | |||
* [[Multiple assignment|strand assignment]] (<syntaxhighlight lang=apl inline>(a b)←c</syntaxhighlight>) | |||
* [[indexed assignment]] (<syntaxhighlight lang=apl inline>a[b]←c</syntaxhighlight>) | |||
* [[dop|user-defined operators]] (<syntaxhighlight lang=apl inline>{⍺⍺ ⍵⍵}</syntaxhighlight>), using the <syntaxhighlight lang=apl inline>⍶</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍹</syntaxhighlight> glyphs in place of Dyalog's <syntaxhighlight lang=apl inline>⍺⍺</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍵⍵</syntaxhighlight>. | |||
The following features of Dyalog APL are not supported: | |||
* <syntaxhighlight lang=apl inline>!</syntaxhighlight> does not work with negative or complex operands. | |||
* [[Where]] (<syntaxhighlight lang=apl inline>⍸</syntaxhighlight>) | |||
* [[Over]] (<syntaxhighlight lang=apl inline>⍥</syntaxhighlight>) | |||
* [[Atop]] (<syntaxhighlight lang=apl inline>⍤</syntaxhighlight>) | |||
* [[Nest]] (<syntaxhighlight lang=apl inline>⊆</syntaxhighlight>) | |||
* [[Partitioned enclose]] (<syntaxhighlight lang=apl inline>⊆</syntaxhighlight>) | |||
* [[At]] (<syntaxhighlight lang=apl inline>@</syntaxhighlight>) | |||
* [[Stencil]] (<syntaxhighlight lang=apl inline>⌺</syntaxhighlight>) | |||
* [[Unique mask]] (<syntaxhighlight lang=apl inline>≠</syntaxhighlight>) | |||
* [[Key]] (<syntaxhighlight lang=apl inline>⌸</syntaxhighlight>) | |||
* [[Rank (operator)|Rank (operator]] (<syntaxhighlight lang=apl inline>⍤</syntaxhighlight>) | |||
* [[tradfn]]s (<syntaxhighlight lang=apl inline>∇R←X f Y</syntaxhighlight>) | |||
* non-zero [[index origin]] (<syntaxhighlight lang=apl inline>⎕IO←1</syntaxhighlight>) | |||
* [[comparison tolerance]] (<syntaxhighlight lang=apl inline>⎕CT</syntaxhighlight>) | |||
* [[prototype]]s (it always uses zero as fill) | |||
* [[modified assignment]] (<syntaxhighlight lang=apl inline>x+←1</syntaxhighlight>) | |||
* [[keyword]]s (<syntaxhighlight lang=apl inline>:If</syntaxhighlight>) | |||
* [[object-oriented programming]] | |||
* [[namespace]]s. | |||
* inverses. | |||
It extends Dyalog APL with: | |||
* [[Infinity|infinities]] (<syntaxhighlight lang=apl inline>¯</syntaxhighlight> or <syntaxhighlight lang=apl inline>∞</syntaxhighlight>) | |||
* the identity element operator (<syntaxhighlight lang=apl inline>⍁</syntaxhighlight>) | |||
* exceptions (<syntaxhighlight lang=apl inline>↗</syntaxhighlight>) | |||
== External links == | |||
* [http://archive.vector.org.uk/art10501160 ''Compiling APL to JavaScript''] article in the [[Vector journal]] | * [http://archive.vector.org.uk/art10501160 ''Compiling APL to JavaScript''] article in the [[Vector journal]] | ||
* [https://repl.it/languages/APL ngn/apl on REPL] | * [https://repl.it/languages/APL ngn/apl on REPL] |
Latest revision as of 12:25, 31 August 2023
ngn/apl is an APL bytecode compiler and interpreter by Nick Nickolov. Because it is implemented in Javascript, it can be run in Node.js or any modern browser.
On December 27, 2020, Nickolov announced that he would discard his implementation.[1] Soon after, Adám Brudzewsky took up the mantle of hosting the source and online demo.[2]
Features
ngn/apl partially supports some of the core language of Dyalog APL 14.0:
- dfns (
{⍺ ⍵}
) - nested arrays
- complex numbers (
1j2
) - forks and atops
- strand assignment (
(a b)←c
) - indexed assignment (
a[b]←c
) - user-defined operators (
{⍺⍺ ⍵⍵}
), using the⍶
and⍹
glyphs in place of Dyalog's⍺⍺
and⍵⍵
.
The following features of Dyalog APL are not supported:
!
does not work with negative or complex operands.- Where (
⍸
) - Over (
⍥
) - Atop (
⍤
) - Nest (
⊆
) - Partitioned enclose (
⊆
) - At (
@
) - Stencil (
⌺
) - Unique mask (
≠
) - Key (
⌸
) - Rank (operator (
⍤
) - tradfns (
∇R←X f Y
) - non-zero index origin (
⎕IO←1
) - comparison tolerance (
⎕CT
) - prototypes (it always uses zero as fill)
- modified assignment (
x+←1
) - keywords (
:If
) - object-oriented programming
- namespaces.
- inverses.
It extends Dyalog APL with:
- infinities (
¯
or∞
) - the identity element operator (
⍁
) - exceptions (
↗
)
External links
- Compiling APL to JavaScript article in the Vector journal
- ngn/apl on REPL
- ngn/APL on Try It Online
- Online demo
- Online session
- Source code
References
- ↑ Nickolov, N. "ngn". Announcement. APL Orchard. Stack Exchange chat.
- ↑ Brudzewsky, A. "Adám". Announcement. APL Orchard. Stack Exchange chat.
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 |