Surreal FOREVER loop
A Surreal FOREVER
loop is an esoteric language construct that allows an infinite loop to be completed. Technically, general surreal forever loops are impossible in any Turing-complete language (you would need to solve the Halting Problem), but it's a nice idea.
Structure
The surreal forever loop is a loop that executes code infinitely many times in a finite period of time. It accomplishes this by analyzing the code provided and calculating what happens if you repeat it ad infinitum. This is, of course, impossible (what if the loop is calculating if a given Turing Machine has halted at a particular step? If you were to repeat that infinitely many times, it would be able to calculate what happens with the TM in the end- whether or not its halted. If it has, the loop itself must halt at some point. If not, the loop never halts, thus solving the Halting Problem).
If restricted to only allowing certain less-than-complete constructions within the loop, then a real surreal forever loop may be implemented. Techniques from total programming language design can be used to ensure that all programs within a loop either halt or confidently loop with a definite final effect on the memory. Like total languages in general, there will always be programs that can be shown to halt/loop under some axioms, but nonetheless are not able to be shown to by the axioms which the surreal forever loop bearing language uses.
Alternatively, less powerful automata which have solvable halting problems, like finite state machines, pushdown automata, or even linear bounded automata could be implemented as a sublanguage, with surreal forever loop bodies using this special less powerful sublanguage.