Why obsess over the compiler running into a loop? That's way less harmful than the compiled application getting into a loop on the end user's machine.
You can write useful programs in Agda. I wrote all kinds of programs in Agda including parsers and compilers.