Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Simple—it's not Turing complete. The whole premise is to eliminate recursive structure. Replacing them are measured folds and unfolds of data and codata respectively. These allow you to get as close to infinity as needed on both sides without going over (for some moderate syntactic and semantic penalties).

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.



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?


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: