An example of porting ATS code

57 views
Skip to first unread message

gmhwxi

unread,
Mar 29, 2014, 3:53:51 PM3/29/14
to ats-lan...@googlegroups.com
The following gzipped tarball contains a solution to Assignment 8 in a course
I am teaching (http://www.cs.bu.edu/~hwxi/academic/courses/Spring14/CS320.html):

http://www.cs.bu.edu/~hwxi/academic/courses/CS320/Spring14/assignments/08/Wormlike-BF-solution.tgz

The C files in the tarball are generated from some ATS source. You need GTK+-2.0 and libgc to compile it:

make all_ported

I encourage you to give it a try.

My ATS source uses some ATS library code that are yet not publicly available. However, the generated C
code can be compiled as long as ATS-includes and ATS-contrib-includes are available. While this is anticipated,
seeing it as a reality is still quite exciting :)

Cheers!

gmhwxi

unread,
Mar 29, 2014, 5:52:45 PM3/29/14
to ats-lan...@googlegroups.com
By the way, I just used TinyCC (tcc) to compile the C code in the tarball:

make PATSCC=tcc CC=tcc MYCCRULE=PORTABLE -f Makefile

It is really lightening fast!

Maybe this opens an avenue to using ATS as a scripting language :)

gmhwxi

unread,
Mar 29, 2014, 6:01:34 PM3/29/14
to ats-lan...@googlegroups.com
Unfortunately, the code generated by tcc crashes :(

gmhwxi

unread,
Mar 30, 2014, 2:33:42 AM3/30/14
to ats-lan...@googlegroups.com
I was using tcc-0.9.25.

With tcc-0.9.26, the code can be compiled successfully!
Reply all
Reply to author
Forward
0 new messages