Caterpillar

Daily Thought - 2024-11-25

< back to list

I've been talking about a technique to work around the problem that instructions are not atomic. But why not just make them atomic in the first place?

First, that workaround is also a solution to rewinding, and seemingly the most promising one for now. That it works around the lack of atomicity is a bonus. Second, making instructions atomic is not trivial. Instructions would need to check the runtime state first, before making changes. That check and the changes made, would need to be in sync.

That's a lot of error-prone code to write and to test, and to keep working and tested. And on top of that, it will grow linearly with the number of instructions. Given that the bytecode interpreter is just a placeholder, and I want to compile to native code (and WebAssembly) eventually, that doesn't seem like a good use of resources.

<< previous thoughtnext thought >>