A purely functional fixed timestep loop
There is a great article by Glenn Fiedler titled “Fix Your Timestep!” in which the author explains various approaches to writing a game loop and concludes with a loop that provides a fixed time step for simulation. If you are not familiar with this topic go read the article first and come back later. The author has written the implementation in C or C++ using a lot of mutation and looping, so I wanted to give a purely functional approach a shot.