From c38d6fa154bdf691d199168563d4ab2c7d760b4e Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 28 Mar 2021 19:42:34 -0400 Subject: Update section on assembling VM and bytecode --- docs/implementation/vm.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs/implementation/vm.html') diff --git a/docs/implementation/vm.html b/docs/implementation/vm.html index 50f19d1b..75e71ad1 100644 --- a/docs/implementation/vm.html +++ b/docs/implementation/vm.html @@ -540,17 +540,20 @@

Structure

The following steps give a working BQN system, assuming a working VM and core runtime:

The compiler takes the runtime as 𝕨 and source code as 𝕩. To evaluate BQN source code, convert it into a BQN string (rank-1 array of characters), pass this string and runtime to the compiler, and evaluate the result as bytecode. Results can be formatted with the formatter for use in a REPL, or used from the implementation language.

Testing

I recommend roughly the following sequence of tests to get everything working smoothly. It can be very difficult to figure out where in a VM things went wrong, so it's important to work methodically and make sure each component is all right before moving to the next.

+

Because the compiler works almost entirely with lists of numbers, a correct fill implementation is not needed to run the compiler. Instead, you can define Fill as 0 and _fillBy_ as {𝔽} to always use a fill element of 0.

-- cgit v1.2.3