BQN: Difference between revisions

Jump to navigation Jump to search
4,812 bytes added ,  21:46, 29 September 2020
Primitive tables
(Infobox and introduction)
 
(Primitive tables)
Line 21: Line 21:


'''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 [[backwards compatibility|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 [[wikipedia:context-free grammar|context-free grammar]] with [[wikipedia:first-class function|first-class function]]s, and uses a new set of [[glyph]]s 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]].
'''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 [[backwards compatibility|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 [[wikipedia:context-free grammar|context-free grammar]] with [[wikipedia:first-class function|first-class function]]s, and uses a new set of [[glyph]]s 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 ===
{|class=wikitable
! Glyph                    !! Monadic                  !! Dyadic
|-
| <source inline>+</source> || [[Conjugate]]            || [[Add]]
|-
| <source inline>-</source> || [[Negate]]                || [[Subtract]]
|-
| <source inline>×</source> || [[Sign]]                  || [[Multiply]]
|-
| <source inline>÷</source> || [[Reciprocal]]            || [[Divide]]
|-
| <source inline>⋆</source> || [[Exponential]]          || [[Power (function)|Power]]
|-
| <source inline>√</source> || [[Square Root]]          || [[Root]]
|-
| <source inline>⌊</source> || [[Floor]]                || [[Minimum]]
|-
| <source inline>⌈</source> || [[Ceiling]]              || [[Maximum]]
|-
| <source inline>∧</source> || Sort Up                  || [[And]]
|-
| <source inline>∨</source> || Sort Down                || [[Or]]
|-
| <source inline>¬</source> || [[Not]]                  || Span
|-
| <source inline>|</source> || [[Absolute Value]]        || [[Residue|Modulus]]
|-
| <source inline>≤</source> ||                          || [[Less Than or Equal to]]
|-
| <source inline><</source> || [[Enclose]]              || [[Less Than]]
|-
| <source inline>></source> || [[Mix|Merge]]            || [[Greater Than]]
|-
| <source inline>≥</source> ||                          || [[Greater Than or Equal to]]
|-
| <source inline>=</source> || [[Rank]]                  || [[Equals]]
|-
| <source inline>≠</source> || [[Tally|Length]]          || [[Not Equals]]
|-
| <source inline>≡</source> || [[Depth]]                || [[Match]]
|-
| <source inline>≢</source> || [[Shape]]                || [[Not Match]]
|-
| <source inline>⊣</source> || [[Identity]]              || [[Left]]
|-
| <source inline>⊢</source> || [[Identity]]              || [[Right]]
|-
| <source inline>⥊</source> || [[Ravel|Deshape]]        || [[Reshape]]
|-
| <source inline>∾</source> || [[Raze|Join]]            || [[Catenate|Join to]]
|-
| <source inline>≍</source> || Solo                      || Couple
|-
| <source inline>↑</source> || Prefixes                  || [[Take]]
|-
| <source inline>↓</source> || Suffixes                  || [[Drop]]
|-
| <source inline>↕</source> || [[Index Generator|Range]] || Windows
|-
| <source inline>»</source> || Nudge                    || Shift Before
|-
| <source inline>«</source> || Nudge Back                || Shift After
|-
| <source inline>⌽</source> || [[Reverse]]              || [[Rotate]]
|-
| <source inline>⍉</source> || [[Transpose]]            || [[Transpose|Reorder axes]]
|-
| <source inline>/</source> || [[Indices]]              || [[Replicate]]
|-
| <source inline>⍋</source> || [[Grade|Grade Up]]        || [[Interval_Index|Bins Up]]
|-
| <source inline>⍒</source> || [[Grade|Grade Down]]      || [[Interval_Index|Bins Down]]
|-
| <source inline>⊏</source> || First Cell                || Select
|-
| <source inline>⊑</source> || [[First]]                || Pick
|-
| <source inline>⊐</source> || Classify                  || [[Index of]]
|-
| <source inline>⊒</source> || [[Occurrence Count]]      || [[Progressive Index of]]
|-
| <source inline>∊</source> || [[Unique Mask]]          || [[Member of]]
|-
| <source inline>⍷</source> || [[Unique|Deduplicate]]    || [[Find]]
|-
| <source inline>⊔</source> || Group Indices            || Group
|}
=== Modifiers ===
[[Monadic operator|1-modifiers]] in BQN use superscript symbols, while [[Dyadic operator|2-modifiers]] use symbols with a circle, but not one with a line through it like <source inline>⌽</source> and <source inline>⍉</source>.
{|
|style="vertical-align:top"|
{|class=wikitable
! Glyph                    !! Name(s)
|-
| <source inline>˙</source> || [[Constant]]
|-
| <source inline>˜</source> || [[Commute|Self/Swap]]
|-
| <source inline>˘</source> || Cells
|-
| <source inline>¨</source> || [[Each]]
|-
| <source inline>⌜</source> || [[Outer Product|Table]]
|-
| <source inline>⁼</source> || Undo
|-
| <source inline>´</source> || [[Reduce|Fold]]
|-
| <source inline>˝</source> || [[Reduce|Insert]]
|-
| <source inline>`</source> || [[Scan]]
|}
|style="vertical-align:top"|
{|class=wikitable
! Glyph                    !! Name(s)
|-
| <source inline>∘</source> || [[Atop]]
|-
| <source inline>○</source> || [[Over]]
|-
| <source inline>⊸</source> || [[Before]]/[[Bind]]
|-
| <source inline>⟜</source> || [[After]]/[[Bind]]
|-
| <source inline>⌾</source> || [[Under]]
|-
| <source inline>⊘</source> || Valences
|-
| <source inline>◶</source> || Choose
|-
| <source inline>⎉</source> || [[Rank (operator)|Rank]]
|-
| <source inline>⚇</source> || [[Depth (operator)|Depth]]
|-
| <source inline>⍟</source> || [[Power (operator)|Repeat]]
|}
|}


{{APL dialects}}[[Category:BQN| ]][[Category:Array languages]][[Category:Based array languages]][[Category:Leading axis languages]][[Category:Languages with tacit programming]]
{{APL dialects}}[[Category:BQN| ]][[Category:Array languages]][[Category:Based array languages]][[Category:Leading axis languages]][[Category:Languages with tacit programming]]

Navigation menu