The language has become a little too complex than I expected. In the beginning, I only want these features:
inputs in various data types: decimal, hex, binary string and bytes.
define new words, compiled to opcodes.
unroll do..loop
Then, other features are added:
interpreter
literal
macros
Things began to become more and more complicated and gradually lost its initial meaning. I realized the key is just "compile to opcodes" not "a language can do anything off-chain". In fact, using simple string replacing we can inject the off-chain data into the MiniForth:
: word1
{{ arg }} dup +
;
Just replace the {{ arg }} with any off-chain computed data, people can use any programming language to do the off-chain stuff.
Now I will focus on the 3 initial goals above, and port the compiler into JS. (the bsv.js has a great interpreter we can use it).
The language has become a little too complex than I expected. In the beginning, I only want these features:
Then, other features are added:
Things began to become more and more complicated and gradually lost its initial meaning. I realized the key is just "compile to opcodes" not "a language can do anything off-chain". In fact, using simple string replacing we can inject the off-chain data into the MiniForth:
Just replace the
{{ arg }}
with any off-chain computed data, people can use any programming language to do the off-chain stuff.Now I will focus on the 3 initial goals above, and port the compiler into JS. (the bsv.js has a great interpreter we can use it).