From 1905bec865e28a6939021b77712e5afbeb0e460e Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 26 Jan 2022 08:02:05 -0500 Subject: Update link to dc.bqn --- docs/implementation/vm.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/implementation') 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 @@

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.

Bytecode

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 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 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 adapts it to be compatible with dzaima/BQN.

dzaima/BQN can interpret bytecode or convert it to JVM 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 as a reference (for bytecode execution only) when implementing a BQN virtual machine.

Components

The complete bytecode for a program consists of the following:

-- cgit v1.2.3