17 ms·
> Getting around the limitations I mentioned for stackful coroutines would be immensely more challenging. Challenging but it's definitely been done before. The
by speedplane 7y ago
> Getting around the limitations I mentioned for stackful coroutines would be immensely more challenging.
Challenging but it's definitely been done before. The system below [1] (disclosure: I worked on it years ago), stores every memory write in a separate buffer on the assembly level. You need to modify the compiler for this, and it cuts performance roughly in half, but it allows you to step backwards in code and perform sophisticated performance analysis.
[1] https://www.ghs.com/products/timemachine.html https://www.ghs.com/products/timemachine.html
- byuu 7y agoOh certainly, it's just beyond what I can do as a C library. I've also seen another approach that implemented a customized libc replacement to allow this to work. But that and modifying the compiler itself are really extreme steps. It's still doable, and it's definitely worth doing, but I understand the uses I've mentioned are rather niche, so it's unlikely to occur. For one, we still don't have built-in stackful coroutine support even in C++20.
- speedplane 7y ago> modifying the compiler itself are really extreme steps Yes, it's not for the average developer. Yet it should be incumbent on the tools builders. I'm actually surprised that most compilers/interpreters don't have a "step backwards" flag that you can turn on during compile/run-time. It would be a helpful feature to expert and novice developers alike, but hasn't really caught on outside of niche areas.