Skip to content

Block Disassembly/Reassembly

username-removed-240561 requested to merge pull/9/disassemble into master

Created by: acook

This allows Blocks to be decompiled into Text, recompiled on-the-fly, disassembled into a Vector of their contents and reassembled from a Vector into a new Block.

This also creates a dedicated opword type, this finally introduces a difference between words intended to be used as symbols and words intended to be executed directly. The opword is similar to Forth's execution tokens and may grow to include non-builtin operations.

Trello card here

Caveats

Currently, there are no ways to manipulate or create opwords outside of block disassembly, but there are plans to improve them. Furthermore, the terminology around words and opwords is still fuzzy and will likely be changed.

Attempting to serialize a Meta, Q, O, or S will fail. These are not logically serializable types. However, O will become a serializable type in the future, and at that point this should be reconsidered.

There is a lot of code duplication, refactoring is to be done once a better understanding of the pattern emerges.

Merge request reports