2 ms·
Thanks! As long as the screen can be described entirely by the IO rendering functions and the state within the recorded Lua data structures, there's no need to
by meric 11y ago
Thanks! As long as the screen can be described entirely by the IO rendering functions and the state within the recorded Lua data structures, there's no need to record each pixel color - simply replay the IO rendering functions in the same order using the same Lua state.
The prototype takes advantage of the fact during every frame the screen is reset, and is rendered from scratch. The prototype's "time travelling" works by going back to the very beginning of the program, and replaying every single step. Even if the screen isn't reset every frame, as long as the program can reset the screen when it goes back to the beginning, it will be able to handle replaying the graphics IO.
With "additive" IO functions, such as `print`, which "adds" rather than "resets" the terminal on each "frame", I think there will be a need to replace those functions with an alternate set that does IO through a medium where past additions to the output can be modified. e.g. using ncurses instead of terminal, to show program output.
- deleted 11y ago[deleted]