Re:Morte: an intermediate language for super-optimizing func...
by bigcojosh on Friday September 12, 2014 @05:18PM
(#8310520)
How will be Morte used to do "real work"? Would it always have to be called from a larger language that can do effectful things like IO?
Re:Morte: an intermediate language for super-optimizing func...
by tel on Friday September 12, 2014 @05:28PM
(#8310561)
I have no idea what Gabriel is intending here; I'm just talking from general knowledge about consistent languages like the CIC.
There are a number of general examples, though.
1. You can leave termination guarantees in foreign code up to the programmer using an "unsafe" marker.
2. You can model effects using a monad
3. You can model the whole program as codata which is "driven" by the runtime
4. You can write a compiler of an embedded language in CIC and execute complete programs in, say, C
Within a language like the Calculus of Coinductive Constructions like Morte appears to implement it's not such a strange idea to have normalization.
So, no infinite loops means no Halting Problem means no completeness.
The upside is a larger set of easy-to-perform optimizations, much greater mathematical elegance. The downside is that you cannot directly write an interpreter for a complete language. Though you could write one which halts every N steps and requires user input to continue. In practice, that isn't the worst idea for a repl anyway.