Historically Prolog had an advantage over other languages because it provided backtracking. But a couple of imperative languages now provide at least generators as well:
yieldkeyword is used to pause and resume a generator function
PEP 255 – Simple Generators
PEP 255 -- Simple Generators | Python.org
Some hack with long jump
I am not sure. But the advantage of yield is that it can make a scope of a choice point that includes loops. Whereas in Prolog tail recursion, used for loops, somehow kills and creates choice points.
What happens in Picat if it has non-determinism inside loop and assigment?
Are there some opportunities to improve Prolog? Asking for a friend…