Simple linear objects in ATSCC2JS

32 views
Skip to first unread message

Artyom Shalkhakov

unread,
Oct 5, 2017, 1:15:36 AM10/5/17
to ats-lang-users
Hello all,

Here's an example of a simple linear object in ATS:


Can this be adapted to work in ATSCC2JS?

This code:


Gives the error:

Hello from atscc2js!
ParsingErrors:
/tmp/patsopt_ccats_CEmWFB: 31627(line=872, offs=1) -- 31646(line=872, offs=20): error(parsing): the syntactic entity [instr] is needed.
/tmp/patsopt_ccats_CEmWFB: 31865(line=882, offs=1) -- 31876(line=882, offs=12): error(parsing): the syntactic entity [instr] is needed.
/tmp/patsopt_ccats_CEmWFB: 31865(line=882, offs=1) -- 31876(line=882, offs=12): error(parsing): the syntactic entity [ATSfunbody_end] is needed.
/tmp/patsopt_ccats_CEmWFB: 31032(line=846, offs=1) -- 31046(line=846, offs=15): error(parsing): the keyword [}] is needed.
/tmp/patsopt_ccats_CEmWFB: 30871(line=838, offs=1) -- 30880(line=838, offs=10): error(parsing): the keyword [EOF] is needed.
exit(ATS): uncaught exception at run-time:
/var/lib/openshift/5419477be0b8cddd09000122/app-root/runtime/repo/ats2-lang/contrib/CATS-parsemit/SATS/catsparse.sats:FatalErrorExn(1024)

Some language feature isn't implemented in ATSCC2JS? If yes, I'd be willing to make a PR for it, as long as a hint is given on how to fix it. :-)

Hongwei Xi

unread,
Oct 5, 2017, 7:57:23 AM10/5/17
to ats-lan...@googlegroups.com
Unfortunately, ATSCC2JS can not handle direct use of pointers.

To compile timer.dats into JS code, you can use emscripten. It does work but
it is quite involved.

The rationale behind ATSCC2JS (and other ATSCC2??? compilers) is to support
"co-programming": High-level code is supposed to be done in ATS and low-level
code done in JS.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/4f7e50fa-3698-4107-86ec-b13ab26c1db9%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages