BQN is a modern array programming language that improves upon APL, J, etc. in various ways.
Install CBQN
CBQN is the primary implementation of BQN. It can be installed on Linux as follows:
$ git clone https://github.com/dzaima/CBQN.git
$ cd CBQN
$ make
$ sudo make install
On Windows, install in WSL, or see how to install BQN on Windows & other non-Linux platforms.
Now run bqn
to start REPL, or run a BQN file with: bqn /path/to/script.bqn
.
Note: In Try BQN (online), and after enabling BQN plugin for various editors (eg. Emacs, VS Code), you can type BQN characters by typing corresponding character after backtick \
. Eg. \0
turns into •
. See the keymap for all character codes.
BQNPAD is an online alternative REPL to CBQN. Its top bar has everything you need to know about BQN's special characters. Click to enter it, hover to see its name and the backslash combination you can type instead, and middle- or modified click to go to a help page.
Note: It is slower than CBQN, and has some limitations - for example, some system functions like •Out
and •GetLine
are not available.
In VS Code BQN extension, you can hover over primitives like +
and it will show its help/usage. But this currently doesn't work for system functions like •Out
.
- Output:
•Out "helloworld"
- Input:
•GetLine@
- note that@
is a dummy argument passed to•GetLine
.
See more system functions (system functions start with •
).
- Control Structures
•_while_
NOTE: The underscore_
on both sides ofwhile
indicates its syntactic role as 2-modifer (takes 2 input functions, outputs a function).
- Blog: From Julia to BQN
- BQN Syntax Help
- BQN Symbols Help
- BQN Docs
- BQN Crate - Search for common BQN idioms
- BQN Community Links