It is not yet fully functioning. Here is the code for the compiler:
https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/CATS-atsccomp/CATS-atscc2scmAs an example, the following code is generated based on
https://github.com/githwxi/ATS-Postiats-contrib/blob/master/projects/MEDIUM/CATS-atsccomp/CATS-atscc2scm/TEST/acker.dats(define
(acker arg0 arg1)
(let(
;; knd = 0
(tmpret0 #f)
(tmp1 #f)
(tmp2 #f)
(tmp3 #f)
(tmp4 #f)
;; var Tmplab, Tmplab_scm
) ;; in-of-let
;; __patsflab_acker
(letrec(
(casefnx
(lambda(Tmplab)
(case Tmplab
;; ATSbranchseq_beg
((1)
(if (not (ATSCKpat_int arg0 0))
(casefnx 3)
(begin
(casefnx 2)
)
)
) ;; end-of-branch
((2)
(ats2scmpre_add_int0_int0 arg1 1)
) ;; end-of-branch
;; ATSbranchseq_end
;; ATSbranchseq_beg
((3)
(if (not (ATSCKpat_int arg1 0))
(casefnx 5)
(begin
(casefnx 4)
)
)
) ;; end-of-branch
((4)
(set! tmp1 (ats2scmpre_sub_int0_int0 arg0 1))
(acker tmp1 1)
) ;; end-of-branch
;; ATSbranchseq_end
;; ATSbranchseq_beg
((5)
(set! tmp2 (ats2scmpre_sub_int0_int0 arg0 1))
(set! tmp4 (ats2scmpre_sub_int0_int0 arg1 1))
(set! tmp3 (acker arg0 tmp4))
(acker tmp2 tmp3)
) ;; end-of-branch
;; ATSbranchseq_end
;; _ -> atscc2scm_caseof_deadcode(?FILE, ?LINE)
) ;; end-of-case
) ;; end-of-lambda
) ;; end-of-casefnx
) (casefnx 1)
) ;; end-of-letrec
) ;; end-of-let
) ;; end-of-fun
When using atscc2scm, one should disable tail-call optimization on the ATS side.
I am on my way to write atscc2clj (ATS to Clojure), and atscc2scm is a convenient
by-product.
With atscc2clj, we can generate JVM code by going the route: ATS -> Clojure -> JVM.
Then with lein-droid, we shall be able to write Android apps (partly) in ATS.
Cheers!