not such a great first experience malheureusement

35 views
Skip to first unread message

Raoul Duke

unread,
Jul 16, 2014, 1:53:27 PM7/16/14
to ats-lang-users
hi,

i used brew to install ats-2 on a mac.

* i tried the most basic, i think, hello world example.

* it spits out a lot of stuff that i didn't ask for; if things are
working, don't bother telling me, and don't use "!" as if it is a
miracle that it worked. it sure makes it hard to see where any *real*
problems are.

* it gives me errors. they are obtuse to first time users. what do i
need to change to make this work?

thanks for any help. (version at the bottom)



ATS 533 $ cat test.dats

implement main() = print("Hello World\n");




ATS 534 $ patscc test.dats

exec(patsopt --output test_dats.c --dynamic test.dats)

Hello from ATS2(ATS/Postiats)!

Loading [fixity.ats] starts!

Loading [fixity.ats] finishes!

Loading [basics_pre.sats] starts!

Loading [basics_pre.sats] finishes!

Loading [basics_sta.sats] starts!

Loading [basics_sta.sats] finishes!

Loading [basics_dyn.sats] starts!

Loading [basics_dyn.sats] finishes!

Loading [basics_gen.sats] starts!

Loading [basics_gen.sats] finishes!

The 1st translation (fixity) of [test.dats] is successfully completed!

The 2nd translation (binding) of [test.dats] is successfully completed!

/Users/x/Downloads/tmp/ATS/test.dats: 20(line=1, offs=20) --
41(line=1, offs=41): error(3):
[/home/hwxi/research/Postiats/git/src/pats_trans3_util.dats]:
d3exp_trdn: the dynamic expression cannot be assigned the type
[S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))].

/Users/x/Downloads/tmp/ATS/test.dats: 20(line=1, offs=20) --
41(line=1, offs=41): error(3): mismatch of static terms (tyleq):

The actual term is: S2Ecst(atsvoid_t0ype)

The needed term is: S2Eapp(S2Ecst(g0int_t0ype); S2Ecst(int_kind))

TRANS3: there are [1] errors in total.

exit(ATS): uncaught exception:
_2home_2hwxi_2research_2Postiats_2git_2src_2pats_error_2esats__FatalErrorException(1025)

exec(patsopt --output test_dats.c --dynamic test.dats) = 256


ATS 540 $ patscc -v

exec(gcc -std=c99 -D_XOPEN_SOURCE -I${PATSHOME}
-I${PATSHOME}/ccomp/runtime -L${PATSHOME}/ccomp/atslib/lib
-L${PATSHOME}/ccomp/atslib/lib64 -v)

Using built-in specs.

Target: i686-apple-darwin11

Configured with:
/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure
--disable-checking --enable-werror
--prefix=/Developer/usr/llvm-gcc-4.2 --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm-
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/
--with-slibdir=/usr/lib --build=i686-apple-darwin11
--enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local
--program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11
--target=i686-apple-darwin11
--with-gxx-include-dir=/usr/include/c++/4.2.1

Thread model: posix

gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)

exec(gcc -std=c99 -D_XOPEN_SOURCE -I${PATSHOME}
-I${PATSHOME}/ccomp/runtime -L${PATSHOME}/ccomp/atslib/lib
-L${PATSHOME}/ccomp/atslib/lib64 -v) = 0

gmhwxi

unread,
Jul 16, 2014, 1:57:57 PM7/16/14
to ats-lan...@googlegroups.com

The function 'main' should be changed to 'main0':

implement main0 () = print("Hello World\n")

fun main: () -> int
fun main0: () -> void

Raoul Duke

unread,
Jul 16, 2014, 2:06:12 PM7/16/14
to ats-lang-users
that worked, thanks!

(although it is hard to see that the compiler report is any different
than when it failed. all the extraneous compiler output hides the
actually important stuff, i think.)

i suspect some (more than one) online tutorials need to be updated? :-}
e.g. http://www.ats-lang.org/EXAMPLE/
> --
> 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/48159aed-d0de-4405-b1bc-ad0fdffaf3fe%40googlegroups.com.

Brandon Barker

unread,
Jul 16, 2014, 1:58:26 PM7/16/14
to ats-lang-users
I have to run out but it looks like you just have one line of code -
try to copy over the standard includes in e.g. hello.dats
Brandon Barker
brandon...@gmail.com
> --
> 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/CAJ7XQb4sTxfZ_8oVXAWOny3R%2By3__xvBKM5cZtmr0Bxq1Kn8mg%40mail.gmail.com.

gmhwxi

unread,
Jul 16, 2014, 2:21:51 PM7/16/14
to ats-lan...@googlegroups.com
>>(although it is hard to see that the compiler report is any different
than when it failed. all the extraneous compiler output hides the
actually important stuff, i think.)

Usually the first error is the most informative one.


>>i suspect some (more than one) online tutorials need to be updated? :-}
e.g. http://www.ats-lang.org/EXAMPLE/

Fixed.

Raoul Duke

unread,
Jul 16, 2014, 2:24:00 PM7/16/14
to ats-lang-users
>>>(although it is hard to see that the compiler report is any different
> than when it failed. all the extraneous compiler output hides the
> actually important stuff, i think.)
>
> Usually the first error is the most informative one.

the point is that it is hard to see if there *are* any errors are not.
needle in the haystack of output from the compiler.

gmhwxi

unread,
Jul 16, 2014, 2:41:30 PM7/16/14
to ats-lan...@googlegroups.com
If you use emacs+ats2-mode, then the bottom bar tells
you whether there is any type-error during type-checking.

(Compilation:exit [0]) means no type-error

(Compilation:exit [xxx]) means some type-errors

Raoul Duke

unread,
Jul 16, 2014, 2:44:25 PM7/16/14
to ats-lang-users
> If you use emacs+ats2-mode, then the bottom bar tells
> you whether there is any type-error during type-checking.
> (Compilation:exit [0]) means no type-error
> (Compilation:exit [xxx]) means some type-errors

if i have the time Some Day i'll send a pull request for a mode that
turns off all the noisy compiler output :-)

gmhwxi

unread,
Jul 16, 2014, 3:04:33 PM7/16/14
to ats-lan...@googlegroups.com
Okay, I cleaned it up a bit. The change should go into the
next release.
Reply all
Reply to author
Forward
0 new messages