How to run BQN

CBQN is the primary offline implementation, and has build instructions in its own repository. Here and elsewhere it's expected to be installed as bqn. For Windows, build in WSL or go to the repository for the docker builds linked below (WinBQN is another system that's currently unmaintained).

Third-party packages are available for several platforms. Because they run on an unknown target system, none of these packages are built with the highest-performance settings. If you need top speed (you probably don't!) you should compile CBQN for the target hardware instead.

OS/distro Package Type
Windows download docker build Binary
Arch AUR cbqn-git Source
Nix cbqn Source/Binary
Guix cbqn Source/Binary
iOS Arrayground App (source)

For tools related to running BQN, see the editor plugins and fonts page. Also, Beacon is a cross-platform IDE just for BQN!

All these websites run BQN, in your browser unless marked with "server-side" (JS is native Javascript; the Wasm engine is WebAssembly compiled from CBQN).

Link Style Engine Comments
Online REPL One-shot JS "Explain", error marker
BQNPAD Session JS, Wasm Preview, syntax coloring
BQN Editor One-shot JS Coloring, images, audio
Attempt This Online TIO CBQN Server-side
Do Stuff Online TIO JS
Razetime Session JS
ktye/zoo Session JS Many array languages
Observable Notebook JS For import in Observable
BQN-80 One-shot JS Create animations

Details about CBQN as well as the Javascript and other implementations follow.

Self-hosted BQN

Both CBQN and JS BQN are implemented using components written in BQN itself: the compiler, and primitive implementations. The host language provides a bytecode VM and basic functionality for the primitives, and can replace primitives with native implementations for better performance. It also provides system values, so that which ones are supported depends on the host. This setup allows embedding, where programs in the host language can evaluate BQN code.

Support in the following languages has been implemented:

The file docs/bqn.js is zero-dependency Javascript, and can be loaded from HTML or Node.js. For command line use, call the Node.js script bqn.js, passing a file and •args, or -e to execute all remaining arguments directly and print the results.

BQN.rkt

BQN.rkt is an independent implementation entirely in Racket, with primitives that operate on native Racket arrays (as these are multi-dimensional) and a compiler that converts from BQN to Racket syntax. It's incomplete as of this writing.

dzaima/BQN

dzaima/BQN is an implementation in Java created by modifying the existing dzaima/APL, and should be easy to run on desktop Linux and Android. It was historically the main implementation, but is now updated only to stay up to date with language changes. Major missing functionality is dyadic Depth () and set functions ⊐⊒∊⍷ with rank >1, and there are various small differences from the BQN spec, mostly to do with rank, handling of atoms, fills, and headers. It uses UTF-16 instead of UTF-32, so that characters like 𝕩 don't behave correctly.

The only remaining dzaima/BQN script here is test/dzaima, which can be used to test the self-hosted primitives but has been superseded by test/unit.

BQN2NGN

BQN2NGN is a prototype implementation in Javascript built to experiment with the language. It's now abandoned.