I am pleased to announce that
ATS code can now be compiled to Clojure (and then to JVM).
I include an example as follows.
Obviously, the generated Clojure code is not so-called idiomatic Clojure code.
But it is really a lot safer than manually written Clojure code because the source
of the code passes type-checking in ATS.
;;fun
(defn
fact[arg0]
(
with-local-vars
[
;;knd = 0
tmpret0 nil
tmp1 nil
tmp2 nil
tmp3 nil
;;var tmplab, tmplab_clj
] ;; with-local-vars
;; __patsflab_fact
(var-set tmp1 (ats2cljpre_gt_int0_int0 arg0 0))
(if @tmp1
(do
(var-set tmp3 (ats2cljpre_sub_int0_int0 arg0 1))
(var-set tmp2 (fact @tmp3))
(ats2cljpre_mul_int0_int0 arg0 @tmp2)
) ;; if-then
(do
1
) ;; if-else
)
) ;; end-of-with-local-vars
) ;; end-of-fun
Now I need to figure out how to write apps in Clojure :) After that, we should be able to write apps in ATS (via Clojure).
Cheers!