A tactic language doesn't need to be total, since it's only run at compile-time, so no errors can leak into the resulting proof/program. The worst that can happen is the compiler hangs.
Coq comes with "ltac", which is a horrible imperative language that leads to very fragile proofs. On the other hand, mtac is just Coq's normal, total FP language ("gallina"). A monad is used to wrap up general recursion, so that gallina can be used un-changed.
During compilation, these monadic values are forced, which either leads to a value or causes the compiler to hang. This is a really nice compromise, since you can write Haskell-style FP code which "obviously terminates", without having to prove that it terminates, you still have access to all of the nice dependent type machinery, and the end result (the program, not the meta-program) is guaranteed to be total (unlike, say, an Idris function which turns off the totality checker).
What are you referring to? Data/codata checking works with local type inference.
Huh?
inf = Cons 1 inf> Each recursive function call must be on a syntactic subcomponent of its formal parameter.
But it doesn't. But you can't actually use that to get a nonterminating program, because you can't recurse over it:
> Ordinary recursion is not legal over codata, because it might not terminate.
This is similar to the Brown-Palsberg self-interpreter in a total language, which caused a lot of confusion recently because it's not a self-interpreter (it doesn't take source code as an argument). I think it's better to stick with common definitions and accept that total languages are not Turing complete and can't self-interpret.
Is it a common error? Who's commonly saying this? Can you link any examples? It seems a really strange claim to make.
There are a couple in this very discussion:
https://news.ycombinator.com/item?id=12648261
https://news.ycombinator.com/item?id=12648932
A quick Google search I did just now came up with this one, by someone who knows better[1]: By writing programs in a total language like this, you can confidently answer questions that you can't with a Turing-complete language. You've overcome theoretical limitations by changing the problem parameters a little bit—a common approach in engineering.
The only question you can confidently answer is "does the program halt", to which the answer is always yes. You cannot confidently answer any other question any easier than in non-total languages.
You can find more examples in recent discussions about the Ethereum heist, with many suggestions to "just use a non-Turing complete language". Many seem to believe that there are languages that make verification easy, or that Turing completeness is the problem.
> It seems a really strange claim to make
I guess the reasoning goes like this: the impossibility of proving things in general about programs is a result of the halting theorem; we can get around the halting theorem by using languages that only admit programs that halt; assuming the language is still useful -- problem solved!
How many people know about bounded halting? I know I hadn't until rather recently, when I thought about it and somebody pointed out to me that it's at the very core of the time-hierarchy theorem. I think I actually thought about it because of total languages, when I realized that every program can be assumed to be total without loss of generality, and so totality cannot add actionable information.
[1]: https://www.quora.com/Can-we-solve-the-halting-problem-by-de...
Free (() ->) Integer
And then using corecursion to evaluate this step by step.The actual definition of Turing completeness is the ability to implement any program that a Turing machine can compute, which you can with corecursion.