BQN: Difference between revisions

Jump to navigation Jump to search
m
→‎Functions: Link to Pair for Enlist
No edit summary
m (→‎Functions: Link to Pair for Enlist)
 
(19 intermediate revisions by 2 users not shown)
Line 8: Line 8:
| released                = 2020
| released                = 2020
| developer                = [[Marshall Lochbaum]]
| developer                = [[Marshall Lochbaum]]
| latest release version  = 2022 (unversioned)
| latest release version  = 0.6.0 / 2024-01-09
| implementation languages = BQN with [[wikipedia:JavaScript|JavaScript]], [[wikipedia:C (programming language)|C]], or others<ref name="running">[[Marshall Lochbaum]]. [https://mlochbaum.github.io/BQN/running.html "How to run BQN"]</ref>
| implementation languages = BQN with [[wikipedia:JavaScript|JavaScript]], [[wikipedia:C (programming language)|C]], or others<ref name="running">[[Marshall Lochbaum]]. [https://mlochbaum.github.io/BQN/running.html "How to run BQN"]</ref>
| source                  = [https://github.com/mlochbaum/BQN GitHub]
| source                  = [https://github.com/mlochbaum/BQN GitHub]
Line 18: Line 18:
| forum                    = [https://app.element.io/#/room/%23bqn:matrix.org #bqn:matrix.org]
| forum                    = [https://app.element.io/#/room/%23bqn:matrix.org #bqn:matrix.org]
| influenced by            = [[J]], [[A+]], [[Dyalog APL]], [[Co-dfns]], [[APL\iv]], [[wikipedia:JavaScript|JavaScript]]<ref>[[Marshall Lochbaum]]. [https://mlochbaum.github.io/BQN/commentary/history.html "BQN's development history"].</ref>
| influenced by            = [[J]], [[A+]], [[Dyalog APL]], [[Co-dfns]], [[APL\iv]], [[wikipedia:JavaScript|JavaScript]]<ref>[[Marshall Lochbaum]]. [https://mlochbaum.github.io/BQN/commentary/history.html "BQN's development history"].</ref>
| influenced              =
| influenced              = [[Goal]], [[Kap]], [[Uiua]]
| run online              = [https://bqnpad.mechanize.systems/ BQNPAD]
| run online              = [https://bqnpad.mechanize.systems/ BQNPAD]
}}
}}


'''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, uses a new set of [[glyph]]s with different primitive pairings, and implements [[character arithmetic]]. 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]].


== Implementations ==
== Implementations ==
Line 57: Line 57:
| <code>⌈</code> || [[Ceiling]]              || [[Maximum]]
| <code>⌈</code> || [[Ceiling]]              || [[Maximum]]
|-
|-
| <code>∧</code> || Sort Up                   || [[And]]
| <code>∧</code> || [[Sort Up]]              || [[And]]
|-
|-
| <code>∨</code> || Sort Down                 || [[Or]]
| <code>∨</code> || [[Sort Down]]            || [[Or]]
|-
|-
| <code>¬</code> || [[Not]]                  || Span
| <code>¬</code> || [[Not]]                  || Span
Line 89: Line 89:
| <code>∾</code> || [[Raze|Join]]            || [[Catenate|Join to]]
| <code>∾</code> || [[Raze|Join]]            || [[Catenate|Join to]]
|-
|-
| <code>≍</code> || Solo                     || Couple
| <code>≍</code> || [[Solo]]                  || [[Couple]]
|-
| <code>⋈</code> || [[Pair|Enlist]]          || [[Pair]]
|-
|-
| <code>↑</code> || Prefixes                  || [[Take]]
| <code>↑</code> || Prefixes                  || [[Take]]
Line 115: Line 117:
| <code>⊑</code> || [[First]]                || Pick
| <code>⊑</code> || [[First]]                || Pick
|-
|-
| <code>⊐</code> || Classify                 || [[Index of]]
| <code>⊐</code> || [[Classify]]              || [[Index of]]
|-
|-
| <code>⊒</code> || [[Occurrence Count]]      || [[Progressive Index of]]
| <code>⊒</code> || [[Occurrence Count]]      || [[Progressive Index of]]
|-
|-
| <code>∊</code> || [[Unique Mask]]           || [[Member of]]
| <code>∊</code> || [[Nub Sieve|Mark Firsts]] || [[Member of]]
|-
|-
| <code>⍷</code> || [[Unique|Deduplicate]]    || [[Find]]
| <code>⍷</code> || [[Unique|Deduplicate]]    || [[Find]]
|-
|-
| <code>⊔</code> || Group Indices             || Group
| <code>⊔</code> || [[Group Indices]]        || [[Group (BQN)|Group]]
|-
| <code>!</code> || Assert                    || Assert with Message
|}
|}


Line 145: Line 149:
| <code>⌜</code> || [[Outer Product|Table]]
| <code>⌜</code> || [[Outer Product|Table]]
|-
|-
| <code>⁼</code> || Undo
| <code>⁼</code> || [[Undo]]
|-
|-
| <code>´</code> || [[Reduce|Fold]]
| <code>´</code> || [[Reduce|Fold]]
Line 157: Line 161:
! Glyph                    !! Name(s)
! Glyph                    !! Name(s)
|-
|-
| <code>∘</code> || [[Atop]]
| <code>∘</code> || [[Atop (operator)|Atop]]
|-
|-
| <code>○</code> || [[Over]]
| <code>○</code> || [[Over]]
Line 176: Line 180:
|-
|-
| <code>⍟</code> || [[Power (operator)|Repeat]]
| <code>⍟</code> || [[Power (operator)|Repeat]]
|-
| <code>⎊</code> || Catch
|}
|}
|}
|}
Line 188: Line 194:
Lochbaum recounts, "I obtained 'BQN' by moving each letter in 'APL' forward by one in the alphabet. I'd come up with the backronym 'Big Questions Notation' by the time I realized N doesn't come after L."<ref>[[Marshall Lochbaum]]. [https://chat.stackexchange.com/transcript/message/54753804#54753804 Stack Exchange Transcript]</ref>
Lochbaum recounts, "I obtained 'BQN' by moving each letter in 'APL' forward by one in the alphabet. I'd come up with the backronym 'Big Questions Notation' by the time I realized N doesn't come after L."<ref>[[Marshall Lochbaum]]. [https://chat.stackexchange.com/transcript/message/54753804#54753804 Stack Exchange Transcript]</ref>


Lochbaum commented further on this in Episode 7 of the Array Cast, saying,
Lochbaum commented further on this, saying:


<blockquote>
<blockquote>
...the way I came up with the name BQN was I thought, ... alright, I'm working on this next APL. What do I call [it?] ... I took took APL and I moved it forward and I got BQN. And I said, well, BQN, that sounds pretty good... [B]ig Questions Notation is what I ended up with. I like it 'cause it suggests that not only you're solving big questions, but you have big questions about the notation, so it's a little tongue in cheek. And I said also, you can pronounce it like bacon, so there's even a food pun like Apple. And after some half hour or an hour of thinking about this, I realized that the letter that comes after L is M, not N. I think it would be much more logical for N to come first, because it's the letter with two humps. BQM is a horrible, horrible name, and so I stuck with BQN.
...the way I came up with the name BQN was I thought, ... alright, I'm working on this next APL. What do I call [it?] ... I took took APL and I moved it forward and I got BQN. And I said, well, BQN, that sounds pretty good... [B]ig Questions Notation is what I ended up with. I like it 'cause it suggests that not only you're solving big questions, but you have big questions about the notation, so it's a little tongue in cheek. And I said also, you can pronounce it like bacon, so there's even a food pun like Apple. And after some half hour or an hour of thinking about this, I realized that the letter that comes after L is M, not N. I think it would be much more logical for N to come first, because it's the letter with two humps. BQM is a horrible, horrible name, and so I stuck with BQN.
<ref>[[Marshall Lochbaum]]. [https://www.arraycast.com/episode-7-transcript The Array Cast, Episode 7]: in response to a question starting at the 11:29 mark</ref>
<ref>[[Array Cast#bqn|Marshall Lochbaum and the BQN array language]]. [[Array Cast]]. Aug 7, 2021. (In response to a question starting at the 11:29 mark.)</ref>
</blockquote>
</blockquote>


Line 198: Line 204:
<references />
<references />


{{APL dialects}}[[Category:BQN| ]][[Category:Array languages]][[Category:Based array languages]][[Category:IR compilers]][[Category:Leading axis languages]][[Category:Languages with tacit programming]]
{{APL dialects}}[[Category:Based array languages]][[Category:Languages with first-class functions]][[Category:IR compilers]][[Category:Leading axis languages]][[Category:Languages with tacit programming]]

Navigation menu