From c0fbd3c6877eb270b957dde5622e0fc5d84595fa Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 29 Apr 2021 13:37:28 -0400 Subject: Fix up references to r.bqn --- implementation/README.md | 2 +- implementation/vm.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'implementation') diff --git a/implementation/README.md b/implementation/README.md index 7f29f70e..223b0734 100644 --- a/implementation/README.md +++ b/implementation/README.md @@ -7,7 +7,7 @@ Notes about how BQN is implemented. There's not too much here yet. - [Comparison to Co-dfns](codfns.md) discusses the general compilation strategy and how it compares to the only other array-based compiler. - [The BQN virtual machine and runtime](vm.md) describes the non-self-hosted parts of the BQN implementation, that is, everything you need to port it to a new platform. -This repository's BQN implementation is written mainly in BQN: the bytecode [compiler](../src/c.bqn) is completely self-hosted, and the [majority of the runtime](../src/r.bqn) is written in BQN except that it is allowed to define primitives; some preprocessing turns the primitives into identifiers. The remaining part, a VM, can be implemented in any language to obtain a version of BQN running in that language. +This repository's BQN implementation is written mainly in BQN: the bytecode [compiler](../src/c.bqn) is completely self-hosted, and the majority of the runtime ([r0](../src/r0.bqn), [r1](../src/r1.bqn)) is written in BQN except that it is allowed to define primitives; some preprocessing turns the primitives into identifiers. The remaining part, a VM, can be implemented in any language to obtain a version of BQN running in that language. The VM used for the online REPL is the [Javascript implementation](../docs/bqn.js). The bytecode matches dzaima/BQN's format, and [an extension](../dc.bqn) to the compiler adjusts the slightly different block declarations to target dzaima+reference BQN. [An earlier experiment](../wc.bqn) targetting [WebAssembly](https://en.wikipedia.org/wiki/WebAssembly) works only on a very small subset of BQN. All versions have automated tests in the [test](../test/) directory. diff --git a/implementation/vm.md b/implementation/vm.md index 8f7c0997..c9d089d9 100644 --- a/implementation/vm.md +++ b/implementation/vm.md @@ -117,9 +117,9 @@ The **SETN**, **SETU**, and **SETM** instructions set a value for a reference. I Primitive functions and modifiers used in a program are stored in its `consts` array. The compiler needs to be passed a *runtime* with the value of every primitive so that these functions and modifiers are available. -While it's perfectly possible to implement the runtime from scratch, the pseudo-BQN file [r.bqn](../src/r.bqn) implements the full runtime in terms of a *core runtime* consisting of a smaller number of much simpler functions. [pr.bqn](../src/pr.bqn) converts this file so that it can be compiled. It changes values in the core runtime to primitives and primitives to generated identifiers, so that the first 22 values in the output's `consts` array are exactly the core runtime, and no other primitives are required. The result is a list of two elements: first the list of all primitive values, and then a function that can be called to pass in two additional core functions used for inferred properties. +While it's perfectly possible to implement the runtime from scratch, the pseudo-BQN files [r0.bqn](../src/r0.bqn) and [r1.bqn](../src/r1.bqn) implement the full runtime in terms of a *core runtime* consisting of a smaller number of much simpler functions. [pr.bqn](../src/pr.bqn) converts this file so that it can be compiled. It changes values in the core runtime to primitives and primitives to generated identifiers, so that the first 22 values in the output's `consts` array are exactly the core runtime, and no other primitives are required. The result is a list of two elements: first the list of all primitive values, and then a function that can be called to pass in two additional core functions used for inferred properties. -The contents of a core runtime are given below. The names given are those used in r.bqn; the environment only provides a list of values and therefore doesn't need to use the same names. For named functions a description is given. For primitives, the implementation should match the BQN specification for that primitive on the specified domain, or the entire domain if left empty. They won't be called outside that domain except if there are bugs in r.bqn. +The contents of a core runtime are given below. The names given are those used in r1.bqn; the environment only provides a list of values and therefore doesn't need to use the same names. For named functions a description is given. For primitives, the implementation should match the BQN specification for that primitive on the specified domain, or the entire domain if left empty. They won't be called outside that domain except if there are bugs in the BQN sources. | Ind | Name | Description / restrictions |----:|------------|--------------------------- -- cgit v1.2.3