how to port?

38 views
Skip to first unread message

Raoul Duke

unread,
Dec 17, 2014, 7:07:04 PM12/17/14
to ats-lang-users
(I feel like I've asked this before so apologies if somebody already
did and I'm being really thick and unable to find the answer via web
searching.)

If I wanted to port ATS to generate some other language as output, is
there a guide to doing that? I could try to divine it from how the
other backends are today, but it would probably be nice for posterity
to have a document about the overall general way to approach it in
steps.

thanks!

gmhwxi

unread,
Dec 19, 2014, 8:56:59 PM12/19/14
to ats-lan...@googlegroups.com
There isn't really any formal documentation at this point. Just code.

First clone the following directory:

https://github.com/githwxi/ATS-Postiats-contrib/tree/master/projects/MEDIUM/ATS-parse-emit

Say you want atscc2XYZ for a language called XYZ.

Create a directory of the name XYZ (or any other name you like) and some symbolic links:

mkdir XYZ
cd XYZ
ln -s ../*.?ats .

Now you can study atscc2py, atscc2js and atscc2php.

1) atscc2py is the hardest as
   it does not support (1) goto labels or (2) switch statements
2) atscc2php is the easiest as it supports both (1) and (2)
3) atscc2js is in the middle: it suports (2) but not (1)

It is a bit unfortunate that atscc2lua seems to need to take the
atscc2py route as Lua does not support either (1) or (2).

Raoul Duke

unread,
Dec 20, 2014, 1:59:07 AM12/20/14
to ats-lang-users
thanks!

Brandon Barker

unread,
May 18, 2015, 10:38:34 AM5/18/15
to ats-lang-users
Is the requirement that switch-like statements support fallthrough a
big part of this delineation?
> --
> You received this message because you are subscribed to the Google Groups
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ats-lang-user...@googlegroups.com.
> To post to this group, send email to ats-lan...@googlegroups.com.
> Visit this group at http://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ats-lang-users/f2570e61-c318-4240-b57d-9d99ab4c9007%40googlegroups.com.



--
Brandon Barker
brandon...@gmail.com

gmhwxi

unread,
May 18, 2015, 11:34:08 AM5/18/15
to ats-lan...@googlegroups.com
No. Fallthrough is not needed.
Reply all
Reply to author
Forward
0 new messages