githwxi / ATS-Postiats

ATS2: Unleashing the Potentials of Types and Templates
www.ats-lang.org
Other
352 stars 54 forks source link

A guide to compile examples? #221

Open piton182 opened 6 years ago

piton182 commented 6 years ago

I am very interested in learning ATS via examples. But I can't seem to compile any. According to the Makefile, I am supposed to have atscc2js in ${PATSHOME}/bin and I don't have it after installing ATS. I can't find in the docs how do I get one?

steinwaywhw commented 6 years ago

Hi piton182, welcome to ATS. For the time being you can try glot.io, a website that can run ATS programs in the browser. Please also search for “Effective ATS”, in google, which is a series of tutorials by Hongwei. ATS-Lang-users is the google group that you can ask any questions.

I can find more document later today and write up some examples this week, which I always wanted to do anyway.

Cheers!

steinwaywhw commented 6 years ago

Also, to compile ATS to binary, you only need patscc or patsopt. The atscc2js tool is only needed if you want to compile your code to Javascript.

Usually to compile some file, you do

patscc -o a.out file.dats
piton182 commented 6 years ago

Nice, thanks! Yes, I've reached out for ATS-Lang-users and have a guy helping me out. glot.io is a great recommendation, thanks. However, I consider the examples runnable (and correct) as I am curious to see what kind of interoperability ATS has with JS. So, I want to run the examples.

steinwaywhw commented 6 years ago

atscc2js is located under contrib/CATS-atscc2js. You can navigate there and make all.

steinwaywhw commented 5 years ago

These two pages have more information on using ATS with Javascript.

http://ats-lang.sourceforge.net/DOCUMENT/ATS2FUNCRASH/HTML/c765.html https://github.com/githwxi/ATS-Postiats/wiki/code-generation

piton182 commented 5 years ago

Thanks! I will definitely check that out