BQN: Difference between revisions
(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]] |
Revision as of 21:46, 29 September 2020
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 ⍉
.
|
|
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 |