Caterpillar

Daily Thought - 2024-11-30

< back to list

I've been talking about rewinding expressions using a runtime-based implementation. But what about a compiler-based approach? The information required to rewind already executed code is only available at runtime. So the work itself is definitely happening then. But the compiler can be responsible for orchestrating that work.

At its core, this would look similar to a runtime-orchestrated approach: There'd be some kind of buffer with information on how to undo an instruction, and that buffer would get filled, as regular (non-rewind) code gets executed.

So basically, the compiler would generate all of the following:

Starting tomorrow, I'm going to take a closer look at this.

<< previous thoughtnext thought >>

Hey, you! Want to subscribe to my daily thoughts? Just let me know (maybe include a nice message, if you're up for it), and I'll send you an email whenever I post a new one.