diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-21 22:08:15 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-07-21 22:08:15 -0400 |
| commit | 41cb98d4b3313c8abe166473b931b515e64cf1a2 (patch) | |
| tree | 064b382326ea8937943fbac95fbe77fdbf4c3cb7 /implementation | |
| parent | 78af096e176ab416d160a0bfeb9e6ffaaecec49d (diff) | |
Revise main implementation README
Diffstat (limited to 'implementation')
| -rw-r--r-- | implementation/README.md | 16 | ||||
| -rw-r--r-- | implementation/primitive/README.md | 1 |
2 files changed, 9 insertions, 8 deletions
diff --git a/implementation/README.md b/implementation/README.md index 2c9ae9c7..c9ba260e 100644 --- a/implementation/README.md +++ b/implementation/README.md @@ -2,18 +2,18 @@ # BQN implementation notes -Notes about how BQN is implemented. There's not too much here yet. +Notes about how BQN is or could be implemented. -- [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. -- [Notes on implementing primitives](primitive/README.md) -- [Notes on compilation](compile/README.md) +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 ([pr](../src/pr.bqn)) turns the primitives into identifiers. -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 remaining part, a Virtual Machine (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), while [CBQN](https://github.com/dzaima/CBQN) is a more advanced VM in C. There are platform-specific and generic tests in the [test](../test/) directory. -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. +- [The BQN virtual machine and runtime](vm.md): the non-self-hosted parts of the BQN implementation, or those needed to port it to a new platform. +- [Notes on implementing primitives](primitive/README.md) +- [Notes on compilation](compile/README.md) +- [Comparison to Co-dfns](codfns.md), the only other array-based compiler. -I have also held some forum discussions on the actual workings of the compiler, but aborted these because the interactive format wasn't doing too much. I haven't yet started on non-interactive replacements. +I held a few early forum discussions on the workings of the self-hosted compiler, but aborted these because the interactive format wasn't doing too much. I haven't yet started on non-interactive replacements. - [Parenthesis nesting level](https://chat.stackexchange.com/rooms/52405/conversation/lesson-s1-parenthesis-nesting-level) - [Infix to RPN](https://chat.stackexchange.com/rooms/52405/conversation/lesson-s2-infix-to-rpn) diff --git a/implementation/primitive/README.md b/implementation/primitive/README.md index 68bdcfca..ac238eff 100644 --- a/implementation/primitive/README.md +++ b/implementation/primitive/README.md @@ -6,6 +6,7 @@ Commentary on the best methods I know for implementing various primitives. Often - [Replicate](replicate.md) - [Sorting](sort.md) +- [Randomness](random.md) Raw speed is of course the most important factor; I also consider predictability and memory usage to be important. Predictability mostly for the benefit of the programmer, but it's also important when there are multiple algorithms to be able to compute which one will be fastest. In some cases an algorithm is best on some subset of inputs, but is effectively useless because it's too difficult to tell if the input falls in that set. Whitney and other K users sometimes profess that binary size is critically important; I don't believe this. |
