From 831b556f20d1e6427d561c0fcb4bb0c6d592314a Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 15 Nov 2021 14:16:25 -0500 Subject: Update and edit suggested VM testing sequence --- docs/implementation/vm.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'docs/implementation') diff --git a/docs/implementation/vm.html b/docs/implementation/vm.html index b6875235..0934ff7d 100644 --- a/docs/implementation/vm.html +++ b/docs/implementation/vm.html @@ -728,13 +728,14 @@

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.

Two formatter arguments Glyph and FmtNum are not part of the runtime. Glyph assumes 𝕩 is a primitive and returns the character (not string) that represents it, and FmtNum assumes 𝕩 is a number and returns a string representing it.

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.

+

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. In order to run test cases before the compiler runs, I strongly recommend building an automated system to compile the test to bytecode using an existing BQN implementation, and run it with the VM being developed.

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