Dear Fellow Clojurians,
I'm pleased to annouce release 0.1.0 of pulley.cps,
a tool for transforming Clojure code into Continuation-Passing-Style.
You can find it at http://github.com/positronic-solutions/pulley.cps.
While this is not the first attempt at such a tool, to the best of my knowledge it is the most complete to date. The rather lengthy Readme (which for now also doubles as User Guide, API Documentation, and design document) goes into more detail, but here's a quick run-down of features:
cps and cps-fn, serve as primary entry points
for transforming code.
binding is fully tail-call optimizable).
set! is not currently implement for dynamic vars,
but due to some recent changes
to the way dynamic environments are implemented
should be trivial to support.
call-cc
and its macro analog let-cc.
throw, try, catch, finally) as you would in regular Clojure code.
clojure.core/apply is overridden to provide an optimized
implementation when invoked from CPS code.
So if you call apply with a CPS function,
continuations, TCO, etc. will still work.
Overall, the goal is to be able to automatically transform
as much "regular clojure code" into CPS
while maintaining seamless interoperation with "native" Clojure code.
The one area I don't think we'll manage to do a satisfactory job on
are forms that create Java types (reify, deftype, genclass, etc.).
These forms are currently completely unsupported,
and any potential future support will most likely consist of simply escaping
the transformation process when these forms are encountered.
Other than that, once exception support is completed,
I think this goal will be within reach.
Near-term development goals are first to implement exceptions. Then I'd like to explore expanding platform support beyond the JVM, namely ClojureCLR and ClojureScript.
Anyway, feel free to give things a try. I greatly treasure your feedback, including bug reports and if you have trouble navigating the documentation.
Have fun,
Nathan Davis
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Clojure" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure/dRN082Ie5Bs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.