I was curious about Dialog’s optimizer, so I tried a little experiment. Here are two files, indirection1.dg and indirection2.dg:
(program entry point)
(alpha)
(alpha)
Hello world!
(program entry point)
(alpha)
(alpha)
(beta)
(beta)
Hello world!
With the current version of the 1b/01-dev compiler, these produce absolutely identical code, down to the byte:
-rw-rw-r-- 1 daniel daniel 5924 Mar 14 18:51 indirection1.z5
-rw-rw-r-- 1 daniel daniel 5924 Mar 14 18:52 indirection2.z5
$ diff indirection1.z5 indirection2.z5 && echo "Identical"
Identical
If I add one more layer of indirection, though:
(program entry point)
(alpha)
(alpha)
(beta)
(beta)
(gamma)
(gamma)
Hello world!
The file grows by four bytes.
I haven’t been able to figure out what exactly changes, or why. But I’m putting it here in case anyone more familiar with Z-machine bytecode might understand.
indirection1.z5 (5.8 KB)
indirection2.z5 (5.8 KB)