On Thu, Mar 28, 2013 at 05:06:22PM -0700, Dannii Willis wrote:
> Thank you for reporting the problem, it's a serious one indeed!
>
[...]
What I admit is unclear to me is why zvm takes the approach it does to
optimization.
There seem two possible approaches: be naive and don't cache anything,
which is simple and robust, if slow. Or cache everything and check
meticulously for when cached things should be refreshed, to avoid
breaking on all of the possible corner cases (such as this one).
While either works, the second requires a Lot More Effort[1], and I'm
not sure that a superfast Z-machine emulator is worth it. After all,
even in javascript, a stupid emulator is surely plenty fast enough for
the not-even-slightly-speed-critical application at hand. (Maybe this
was less true in the past, before people started caring about
javascript performance?)
Tom.
[1] After all, there are (allegedly) only two hard things in computer
science, and cache invalidation is one of them.