diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-01-26 08:02:05 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-01-26 08:02:05 -0500 |
| commit | 1905bec865e28a6939021b77712e5afbeb0e460e (patch) | |
| tree | 7942f8df82c4d1751b95c3560463aff732cf1ab3 | |
| parent | 29bc342af8527f9bada1d011b17d7fd87d4ebdad (diff) | |
Update link to dc.bqn
| -rw-r--r-- | docs/implementation/vm.html | 2 | ||||
| -rw-r--r-- | implementation/vm.md | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/docs/implementation/vm.html b/docs/implementation/vm.html index 63fdd9fc..403e3a41 100644 --- a/docs/implementation/vm.html +++ b/docs/implementation/vm.html @@ -10,7 +10,7 @@ <p>The way data is represented is part of the VM implementation: it can use native arrays or a custom data structure, depending on what the language supports. An initial implementation will be very slow, but can be improved by replacing functions from the BQN-based runtime with native code. As the VM system can be hard to work with if you're not familiar with it, I advise you to contact me to discuss implementing a VM if you are interested.</p> <h2 id="bytecode"><a class="header" href="#bytecode">Bytecode</a></h2> <p>The BQN implementation here and dzaima/BQN share a stack-based object code format used to represent compiled code. This format is a list of numbers of unspecified precision (small precision will limit the length of list literals and number of locals per block, blocks, and constants). Previously it was encoded as bytes with the <a href="https://en.wikipedia.org/wiki/LEB128">LEB128</a> format; while it no longer has anything to do with bytes it's called a "bytecode" because this is shorter than "object code".</p> -<p>The self-hosted compiler uses a simpler, and less capable, format for block and variable data than dzaima/BQN. Only this format is described here; <a href="https://github.com/mlochbaum/BQN/blob/master/implementation/../dc.bqn">dc.bqn</a> adapts it to be compatible with dzaima/BQN.</p> +<p>The self-hosted compiler uses a simpler, and less capable, format for block and variable data than dzaima/BQN. Only this format is described here; <a href="https://github.com/mlochbaum/BQN/blob/master/implementation/../test/dc.bqn">dc.bqn</a> adapts it to be compatible with dzaima/BQN.</p> <p>dzaima/BQN can interpret bytecode or convert it to <a href="https://en.wikipedia.org/wiki/Java_virtual_machine">JVM</a> bytecode, while the Javascript VM previously interpreted bytecode but now always compiles it. Since interpretation is a simpler strategy, it may be helpful to use the <a href="https://github.com/mlochbaum/BQN/blob/f74d9223ef880f2914030c2375f680dcc7e8c92b/bqn.js#L36">old Javascript bytecode interpreter</a> as a reference (for bytecode execution only) when implementing a BQN virtual machine.</p> <h3 id="components"><a class="header" href="#components">Components</a></h3> <p>The complete bytecode for a program consists of the following:</p> diff --git a/implementation/vm.md b/implementation/vm.md index e6264e5b..22d56ef5 100644 --- a/implementation/vm.md +++ b/implementation/vm.md @@ -12,7 +12,7 @@ The way data is represented is part of the VM implementation: it can use native The BQN implementation here and dzaima/BQN share a stack-based object code format used to represent compiled code. This format is a list of numbers of unspecified precision (small precision will limit the length of list literals and number of locals per block, blocks, and constants). Previously it was encoded as bytes with the [LEB128](https://en.wikipedia.org/wiki/LEB128) format; while it no longer has anything to do with bytes it's called a "bytecode" because this is shorter than "object code". -The self-hosted compiler uses a simpler, and less capable, format for block and variable data than dzaima/BQN. Only this format is described here; [dc.bqn](../dc.bqn) adapts it to be compatible with dzaima/BQN. +The self-hosted compiler uses a simpler, and less capable, format for block and variable data than dzaima/BQN. Only this format is described here; [dc.bqn](../test/dc.bqn) adapts it to be compatible with dzaima/BQN. dzaima/BQN can interpret bytecode or convert it to [JVM](https://en.wikipedia.org/wiki/Java_virtual_machine) bytecode, while the Javascript VM previously interpreted bytecode but now always compiles it. Since interpretation is a simpler strategy, it may be helpful to use the [old Javascript bytecode interpreter](https://github.com/mlochbaum/BQN/blob/f74d9223ef880f2914030c2375f680dcc7e8c92b/bqn.js#L36) as a reference (for bytecode execution only) when implementing a BQN virtual machine. |
