Quack is a new functional programming language, centered around continuations. In Quack, continuations are not merely possible to emulate (Haskell), or a convenient control structure and a first-class value (Scheme), but in Quack there is nothing but continuations. You can see them as parameterized GOTO's. We call them Procs, for procedures. Compiled Quack code is executed by reducing Proc to Proc, until a special Proc is reached which signifies end of program. At any time, the state of the program is represented using a Proc.
Using continuations, it is trivial to implement exceptions. Actually, no exceptions as such are planned. The division proc simply calls the return continuation if it succeeds, and the divide-by-zero continuation otherwise.
Values in Quack are immutable: if you have a reference to something, directly or indirectly, then the value can't change.
Unlike Haskell, Quack is not lazy but strict, with its continuations. This is on purpose. Strict evaluation is faster if all results are needed, which is not uncommon. The sequence of reducing continuations follows the source text in most cases, so it is more natural to follow and debug than Haskell's call-by-need. The running time can be analyzed in the same way as for, say, C code. 1)
Currently, Quack is an interpreter written in Python. If you want to do I/O, you can just grab print from Python. I have yet to find out how to do this in a functional way, and let outer code capture what was printed for example. See also with-output-to-string.
Things I still want to try out:
todo and make it possible to get a list of where it is used.It is well possible that several of these are conflicting, but I want to know.
I don't work on it very often, but here's the repository.
Interested? Suggestions? Flames? Drop me a line at bgeron@gmail.com. I'm also usually on IRC: bgeron in irc.freenode.net.
TODO explain Procs better.