EBQN is an experimental implementation of a BQN
virtual machine in Erlang.
It can interpret BQN bytecode, and compile source expressions to bytecode via the BQN self-hosted compiler.
It is extremely slow! This seems due to BQN heap operations and Erlang mutability constraints. Using the JIT-enabled OTP 24 release is highly recommended.
For more information on the rationale behind this project, see the following blog post by Gordon Guthrie:
The BEAM needs an APL-y language
This project is in archive mode and has been replaced with rsbqn
It is recommended to use EBQN by generating BQN bytecode with DBQN.
- Generate BQN bytecode:
$ ./misc/cerl /path/to/mlochbaum/bqn '{𝕩×10}'
- From EBQN root directory:
$ rebar3 shell
- Load the bytecode (using the bytecode from step 1):
1> rr(ebqn).
2> {St0,Rt} = ebqn:runtime().
3> {St1,F} = ebqn:run(St0,[[15,1,25,0,1,0,0,21,0,1,17,25],[ebqn_array:get(2,Rt#a.r),10],[[0,1,0,0],[0,0,3,3]]]).
4> ebqn:call(St1,F,1,undefined).
$ rebar3 compile
1> {St0,Rt} = ebqn:runtime().
2> ebqn_test:test(St0,Rt).