Hi Ricardo Fernández Serrata,
That Go to is part of the used threading technique.
When coding such a VM in assembly, one would use a
register indexed jump with autoincrement instead.
That (single) Go to is at the end of the "next" routine -
but there are many labels, existing as targets for this
computed goto kind of jump.
Here's some information on this technique
The threading model used in this VM is sort of
direct threading, but it's hard to tell with Automate
flows, as there is no execution of real code involved
on this level. I'd put it as a crossover between token
threading and direct threading.
Consider those many "redundant" code/block sequences as
a kind of subroutines, which don't return to the calling
routine, but instead jump directly to the next subroutine.
These "subroutines" are essentially the instructions of
the VM, and need to be distinct, as they ought to be
individually addressable by the VM: the running program
may want to invoke them, expecting them to do exactly what
that single instruction is supposed to do.
The only optimisations I can see here have already
partly been applied: instructions sharing a common code tail,
(2 cases) and ternaries instead of expression blocks where
generating output conditionally is concerned (2 cases) -
Not really the kind of minifying you envisioned in your
comment. I'm afraid there's not much of the optimisation
space which you suggest, and probably also less redundancy
than you may have detected.
Can you give me a specific example which redundant block
I could easily do away with by using some expression, as you