Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

cannadayr/ebqn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EBQN

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

STATUS

This project is in archive mode and has been replaced with rsbqn

Installation

It is recommended to use EBQN by generating BQN bytecode with DBQN.

  1. Setup BQN
  2. Setup DBQN
  3. Setup dbqn as outlined in DBQN documentation.

Usage

  1. Generate BQN bytecode:
$ ./misc/cerl /path/to/mlochbaum/bqn '{𝕩×10}'
  1. From EBQN root directory:
$ rebar3 shell
  1. 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).

Build

$ rebar3 compile

Test

1> {St0,Rt} = ebqn:runtime().
2> ebqn_test:test(St0,Rt).

About

A BQN virtual machine in Erlang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published