I have recently learned to program Arduino and Processing, which are quite similar to one another. I naturally arrived at the conclusion that the most natural structure to an interactive main loop (which is named loop()
in Arduino and draw()
in Processing) would be something like:
void loop() // or draw, or run, or mainloop
{
readInput(); // includes the passage of time
calculateStuff();
updateStuff();
}
So, while reading about the concept, I discovered the "Read-Eval-Print" loop, which seems identical in structure, but not quite appropriate for non-text-based processing (although it is perfect for the gameloops of those CLI-based games).
Specifically the "print" part seems inappropriate in Processing to describe drawing actions, and in Arduino (or any other microcontroller by the way) to describe IO pins output, like blinking or moving stuff.
So the question is: Is there a technical, more general, not-CLI-based term to describe a loop composed by the sequence of reading all input, then calculating updates, then acting on the outputs?
I suspect that most if not all GUI toolkits, and probably other interactive programs, have a similar structure, so perhaps there is a term for it.