BQN: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
(Indicate multiple backends)
Line 168: Line 168:
|}
|}
|}
|}
Some modifiers are closely related, and some of their glyphs are intended to allude to this:
* The three 1-modifers Cells (<code>𝔽˘</code>), Each (<code>𝔽¨</code>), and Undo (<code>𝔽⁼</code>) are equivalent to using a right-[[operand]] of <code>¯1</code> with the 2-modifiers Rank (<code>𝔽⎉¯1</code>), Depth (<code>𝔽⚇¯1</code>), and Repeat (<code>𝔽⍟¯1</code>). Therefore the 2-modifiers are circled versions of the 1-modifiers (except in the case of Undo/Repeat).
* Under (<code>𝔽⌾𝔾</code>) is in principle equivalent to <code>𝔾⁼∘𝔽○𝔾</code>. Therefore, <code>⌾</code> is a combination of the glyphs <code>∘</code> and <code>○</code>.


== References ==
== References ==

Revision as of 18:35, 30 May 2021


BQN is an APL-family language designed primarily by Marshall Lochbaum. Although it maintains the concept of array-driven computing and much of APL's array functionality, BQN discards all compatibility with other array languages and changes many fundamental concepts. It uses the based array model with dedicated array notation, distinguishes between data types and expression roles to give the language a context-free grammar with first-class functions, and uses a new set of glyphs with different primitive pairings. The language uses the leading axis model and tacit programming as core paradigms. Its implementation is largely self-hosted, with an array-based compiler like Co-dfns.

Primitives

Functions

Glyph Monadic Dyadic
+ Conjugate Add
- Negate Subtract
× Sign Multiply
÷ Reciprocal Divide
Exponential Power
Square Root Root
Floor Minimum
Ceiling Maximum
Sort Up And
Sort Down Or
¬ Not Span
| Absolute Value Modulus
Less Than or Equal to
< Enclose Less Than
> Merge Greater Than
Greater Than or Equal to
= Rank Equals
Length Not Equals
Depth Match
Shape Not Match
Identity Left
Identity Right
Deshape Reshape
Join Join to
Solo Couple
Prefixes Take
Suffixes Drop
Range Windows
» Nudge Shift Before
« Nudge Back Shift After
Reverse Rotate
Transpose Reorder axes
/ Indices Replicate
Grade Up Bins Up
Grade Down Bins Down
First Cell Select
First Pick
Classify Index of
Occurrence Count Progressive Index of
Unique Mask Member of
Deduplicate Find
Group Indices Group

Modifiers

1-modifiers in BQN use superscript symbols, while 2-modifiers use symbols with a circle, but not one with a line through it like and .

Glyph Name(s)
˙ Constant
˜ Self/Swap
˘ Cells
¨ Each
Table
Undo
´ Fold
˝ Insert
` Scan
Glyph Name(s)
Atop
Over
Before/Bind
After/Bind
Under
Valences
Choose
Rank
Depth
Repeat

Some modifiers are closely related, and some of their glyphs are intended to allude to this:

  • The three 1-modifers Cells (𝔽˘), Each (𝔽¨), and Undo (𝔽⁼) are equivalent to using a right-operand of ¯1 with the 2-modifiers Rank (𝔽⎉¯1), Depth (𝔽⚇¯1), and Repeat (𝔽⍟¯1). Therefore the 2-modifiers are circled versions of the 1-modifiers (except in the case of Undo/Repeat).
  • Under (𝔽⌾𝔾) is in principle equivalent to 𝔾⁼∘𝔽○𝔾. Therefore, is a combination of the glyphs and .

References


APL dialects [edit]
Maintained APL+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLDyalog APL Visiondzaima/APLGNU APLKapNARS2000PometoTinyAPL
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