Yeah, I figured it was something like that.
I'll try to play around with HX's makefile, thanks for the link!
Here is the original error:
In file included from DATS/hello_dats.c:36:
/usr/lib/ats2-postiats-0.4.2/prelude/CATS/char.cats: In function
'atspre_isascii_int':
/usr/lib/ats2-postiats-0.4.2/prelude/CATS/char.cats:377:11: warning:
implicit declaration of function 'isascii' [-Wimplicit-function-declaration]
377 | return (isascii(c) ? atsbool_true : atsbool_false) ;
| ^~~~~~~
In file included from DATS/hello_dats.c:15:
DATS/hello_dats.c: In function 'mainats_0_void':
DATS/hello_dats.c:206:18: error: 'PMVtmpltcstmat' undeclared (first use in
this function)
206 | ATSINSmove(tmp9,
PMVtmpltcstmat[0](g1int_mul<S2Eextkind(atstype_int)>)(ATSPMVintrep(240),
ATSPMVintrep(160))) ;
| ^~~~~~~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:206:18: note: each undeclared identifier is reported only
once for each function it appears in
206 | ATSINSmove(tmp9,
PMVtmpltcstmat[0](g1int_mul<S2Eextkind(atstype_int)>)(ATSPMVintrep(240),
ATSPMVintrep(160))) ;
| ^~~~~~~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:206:36: error: 'g1int_mul' undeclared (first use in this
function)
206 | SINSmove(tmp9,
PMVtmpltcstmat[0](g1int_mul<S2Eextkind(atstype_int)>)(ATSPMVintrep(240),
ATSPMVintrep(160))) ;
| ^~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:206:46: warning: implicit declaration of function
'S2Eextkind' [-Wimplicit-function-declaration]
206 | mp9,
PMVtmpltcstmat[0](g1int_mul<S2Eextkind(atstype_int)>)(ATSPMVintrep(240),
ATSPMVintrep(160))) ;
| ^~~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:206:57: error: expected expression before 'atstype_int'
206 | ltcstmat[0](g1int_mul<S2Eextkind(atstype_int)>)(ATSPMVintrep(240),
ATSPMVintrep(160))) ;
| ^~~~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:206:70: error: expected expression before ')' token
206 | 1int_mul<S2Eextkind(atstype_int)>)(ATSPMVintrep(240),
ATSPMVintrep(160))) ;
| ^
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c: In function 'fill_screen_2':
DATS/hello_dats.c:290:18: error: 'PMVtmpltcstmat' undeclared (first use in
this function)
290 | ATSINSmove(tmp3,
PMVtmpltcstmat[0](lt_g1int_int<S2Eextkind(atstype_int)>)(arg0, arg1)) ;
| ^~~~~~~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:290:36: error: 'lt_g1int_int' undeclared (first use in
this function)
290 | SINSmove(tmp3, PMVtmpltcstmat[0](lt_g1int_in
<S2Eextkind(atstype_int)>)(arg0, arg1)) ;
| ^~~~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:290:60: error: expected expression before 'atstype_int'
290 | stmat[0](lt_g1int_int<S2Eextkind(atstype_int)>)(arg0, arg1)) ;
| ^~~~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:290:73: error: expected expression before ')' token
290 | 1int_int<S2Eextkind(atstype_int)>)(arg0, arg1)) ;
| ^
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:301:36: error: 'g0int_mod' undeclared (first use in this
function)
301 | SINSmove(tmp5,
PMVtmpltcstmat[0](g0int_mod<S2Eextkind(atstype_int)>)(arg0,
ATSPMVi0nt(0x8000))) ;
| ^~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:301:57: error: expected expression before 'atstype_int'
301 | ltcstmat[0](g0int_mod<S2Eextkind(atstype_int)>)(arg0,
ATSPMVi0nt(0x8000))) ;
| ^~~~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:301:70: error: expected expression before ')' token
301 | 0int_mod<S2Eextkind(atstype_int)>)(arg0, ATSPMVi0nt(0x8000))) ;
| ^
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:311:36: error: 'g1int_add' undeclared (first use in this
function)
311 | SINSmove(tmp6,
PMVtmpltcstmat[0](g1int_add<S2Eextkind(atstype_int)>)(arg0, ATSPMVi0nt(1)))
;
| ^~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:311:57: error: expected expression before 'atstype_int'
311 | ltcstmat[0](g1int_add<S2Eextkind(atstype_int)>)(arg0,
ATSPMVi0nt(1))) ;
| ^~~~~~~~~~~
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
DATS/hello_dats.c:311:70: error: expected expression before ')' token
311 | 1int_add<S2Eextkind(atstype_int)>)(arg0, ATSPMVi0nt(1))) ;
| ^
/usr/lib/ats2-postiats-0.4.2/ccomp/runtime/pats_ccomp_instrset.h:276:37:
note: in definition of macro 'ATSINSmove'
276 | #define ATSINSmove(tmp, val) (tmp = val)
| ^~~
make: *** [<builtin>: DATS/hello_dats.o] Error 1
[email protected] schrieb am Freitag, 21. Mai 2021 um 12:57:29 UTC:
> Can you share the original error message as well?
>
> ATS's prelude heavy relies on templates, so I guess you sign yourself to a
> pain by disabling prelude. For example, you can check how arithmetic
> operators are being defined by issuing
> ```
> find <path_to_ats_prelude> -name '*.sats' -exec grep -s -H "overload +" {}
> \; | less
> ```
>
> just as an example:
> integer.sats contains:
> ```
> typedef
> g1int_add_type
> (tk:tk) =
> {i,j:int}
> (
> g1int(tk, i)
> , g1int(tk, j)
> ) -<fun0> g1int(tk, i+j)
> //
> fun
> {tk:tk}
> g1int_add : g1int_add_type(tk)
> //
>
> overload + with g1int_add of 20
> ```
>
> so g1int_add is a template function and you are missing implementation of
> this function
>
> you might be interested in
> https://groups.google.com/g/ats-lang-users/c/uq02R-L16vo/m/aATk3i3qCQAJ?pli=1
> as well
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/5c4c9cd1-596f-4145-aa55-fa25a37a922en%40googlegroups.com.