# Patscc-pp

**URL:** <https://discourse.ats-lang.org/t/patscc-pp/467>\
**Category:** Google Group\
**Created:** [May 17, 2015, 9:02pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467 "2015-05-17T21:02:47Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [May 17, 2015, 9:02pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/1 "2015-05-17T21:02:47Z")

</div>

Error messages issued by the typechecker of ATS containing strings  
representing  
abstract syntax trees. Such messages can be very informative but are  
difficult to parse  
(especially for beginners).

This thread is meant for people to discuss how “translators” can be written  
so as to  
make ATS error messages easier to access.

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [December 24, 2015, 7:03pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/2 "2015-12-24T19:03:21Z")

</div>

> Error messages issued by the typechecker of ATS containing strings  
> representing  
> abstract syntax trees. Such messages can be very informative but are  
> difficult to parse  
> (especially for beginners).
> 
> This thread is meant for people to discuss how “translators” can be  
> written so as to  
> make ATS error messages easier to access.

I made one, better than a previous ugly one. This new one really parse the  
message. It pretty print using multi‑line and indentation and  
simplification of some expression. The simplification of expression is  
likely to be updated and can be turned on with a global boolean flag. The  
rest is likely to be rather stable. For now, it works best on messages from  
the constraint solver, as this was initially my main issue. Other message  
will be re‑formated, but not simplified (for now).

It search for expressions in message with location only. For each  
expression found, it replace it with a placeholder (the three dots  
character) and display the pretty printed expression below the message.

> **[GitHub - Hibou57/PostiATS-Utilities: Messages pretty printer, JSONized files...](https://github.com/Hibou57/PostiATS-Utilities)**
>
> Messages pretty printer, JSONized files cache and documentation utilities, for ATS/PostiATS (ATS2) - GitHub - Hibou57/PostiATS-Utilities: Messages pretty printer, JSONized files cache and documenta...

I will populate the README file later.

I give two real cases examples to show how it can help.

This:  
/home/yannick/Bureau/Logique/ATS/UTF\_8.dats: 16442(line=508, offs=26) –  
16444(line=508, offs=28): error(3): unsolved constraint: C3NSTRprop(C3TKmain  
(); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst  
(||); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst  
(||); S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(0), S2Evar(c(4157))),  
S2Eapp(S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(127))), S2Eapp(S2Ecst(&&);  
S2Eapp(S2Ecst(\<=); S2Eintinf(128), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=);  
S2Evar(c(4157)), S2Eintinf(2047)))), S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=);  
S2Eintinf(2048), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(4157)),  
S2Eintinf(4095)))), S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(4096),  
S2Evar(c(4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(53247)))),  
S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(53248), S2Evar(c(4157))),  
S2Eapp(S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(55295)))), S2Eapp(S2Ecst(&&);  
S2Eapp(S2Ecst(\<=); S2Eintinf(57344), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=);  
S2Evar(c(4157)), S2Eintinf(65535)))), S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=);  
S2Eintinf(65536), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(4157)),  
S2Eintinf(262143)))), S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(262144  
), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(1048575  
)))), S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(1048576), S2Evar(c(  
4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(1114111)))))

Becomes this:  
UTF\_8.dats:508:26: unsolved constraint: …  
(  
(  
(  
(  
(  
(  
(  
(((0 \<= c) && (c \<= 127)) || ((128 \<= c) && (c \<= 2047)))  
|| ((2048 \<= c) && (c \<= 4095))  
)  
|| ((4096 \<= c) && (c \<= 53247))  
)  
|| ((53248 \<= c) && (c \<= 55295))  
)  
|| ((57344 \<= c) && (c \<= 65535))  
)  
|| ((65536 \<= c) && (c \<= 262143))  
)  
|| ((262144 \<= c) && (c \<= 1048575))  
)  
|| ((1048576 \<= c) && (c \<= 1114111))  
)

This:  
/home/yannick/Bureau/Logique/ATS/test-21.dats: 562(line=21, offs=23) – 564(  
line=21, offs=25): error(3): unsolved constraint: C3NSTRprop(C3TKmain();  
S2Eeqeq(S2Eintinf(1); S2Eapp(S2Ecst(sub\_int\_int); S2EVar(0-\>S2Eapp(S2Ecst(  
sub\_int\_int); S2EVar(5), S2Eintinf(1))), S2Eintinf(1))))

Become this:  
test-21.dats:21:23: unsolved constraint: …  
(1 == (S2EVar(0 → (S2EVar(5) \* 1)) \* 1))

I tested it on a message posted by Artyom Shalkhakov:

His:  
/home/admin/org/ats/lmacrodeftest.dats: 576(line=38, offs=12) – 611(line=38  
, offs=47): error(mac): the form of dynamic expression [D2Esing(D2Eifhead(  
D2Emacfun(iscons; D2Evar(xs$3803(-1))); D2Emacsyn(MSKencode; D2Eseq(  
D2Eapplst(D2Esym(print); D2EXPARGdyn(-1; D2Emacsyn(MSKdecode; D2Emacfun(car;  
D2Evar(xs$3803(-1)))))), D2Emacsyn(MSKdecode; D2Eapplst(D2Emac(auxlist);  
D2EXPARGdyn(-1; D2Emacfun(cdr; D2Evar(xs$3803(-1))), D2Evar(y$3804(-1  
))))))); Some(D2Evar(y$3804(-1)))))] is unsupported for macro expansion.

Become this:  
…/…/…/…/admin/org/ats/lmacrodeftest.dats:38:12: the form of dynamic  
expression […] is unsupported for macro expansion.  
D2Esing(  
D2Eifhead(  
D2Emacfun(iscons; xs$3803);  
D2Emacsyn(  
MSKencode;  
D2Eseq(  
D2Eapplst(  
D2Esym(print);  
D2EXPARGdyn(-1; D2Emacsyn(MSKdecode; D2Emacfun(car; xs$3803)))  
),  
D2Emacsyn(  
MSKdecode;  
D2Eapplst(  
D2Emac(auxlist); D2EXPARGdyn(-1; D2Emacfun(cdr; xs$3803), y$3804  
)  
)  
)  
)  
);  
Some(y$3804)  
)  
)

.

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [February 11, 2016, 6:28am UTC](https://discourse.ats-lang.org/t/patscc-pp/467/3 "2016-02-11T06:28:51Z")

</div>

> I recommended this to the students taking my programming class today 🙂
> 
> Yannick: Could you put some usage examples about pats-filter in your  
> git-hub  
> directory? Such examples should make it a lot easier for users to figure  
> out how  
> to use pats-filter. Examples for other commands are welcome as well.
> 
> Cheers!

Hello,

Sure, I can. I will try to recall later. Just can’t promise when.

I’m busy with a website since some time, that’s why it’s a long time I did  
not come back here, but I don’t forgot ATS.

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [May 19, 2015, 11:40pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/4 "2015-05-19T23:40:08Z")

</div>

> […] Another possibility:
> 
> A web form that you can copy and paste an error from patscc in and  
> choose various output/analysis options. Aside from pretty printing, it  
> could possibly consult a database of errors and solutions/commentary.  
> Of course, it would be great if these could be pulled from this  
> discussion group.

Another entry which may be added: sometime the checker may choose to report  
an error among some other possible errors, and the choice it may make, may  
not be the most relevant one. For an example, see  
[https://groups.google.com/d/msg/ats-lang-users/DcdwRMkv550/cRHQS7-Lh-8J](https://groups.google.com/d/msg/ats-lang-users/DcdwRMkv550/cRHQS7-Lh-8J) .

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [May 17, 2015, 10:12pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/5 "2015-05-17T22:12:08Z")

</div>

> I think this will certainly be great for new users and hopefully  
> others as well. A “filter” has the advantage of not changing the  
> default but having something immediately available to new users (if  
> they know about it, which I guess is the next best thing to a  
> default).
> 
> \*\*Another possibility: \*\*
> 
> A web form that you can copy and paste an error from patscc in and  
> choose various output/analysis options. Aside from pretty printing, it  
> could possibly consult a database of errors and solutions/commentary.  
> Of course, it would be great if these could be pulled from this  
> discussion group.

Or rather additionally. These are two different things and opting for one  
can’t exclude the other.

I will turn the filter I already made, into a wrapper, tomorrow. But this  
will be Python, not ATS and this will not be a general wrapper as I  
described, just this one filter turned into a wrapper.

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [January 1, 2016, 12:10am UTC](https://discourse.ats-lang.org/t/patscc-pp/467/6 "2016-01-01T00:10:27Z")

</div>

> It’s very useful! I tried to explain it at Wiki page.
> 
> [Error messages · githwxi/ATS-Postiats Wiki · GitHub](https://github.com/githwxi/ATS-Postiats/wiki/Error-messages#pretty-print-error-messages)
> 
> Thanks,

Thanks too :-p . I just editor the wilki page after a change in the  
repository: I turned things into a package because I will add some other  
things and it needed to be cleaner. Now the executable is a wrapper named  
`pats-filter`.

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [January 20, 2016, 11:02pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/7 "2016-01-20T23:02:20Z")

</div>

I recommended this to the students taking my programming class today 🙂

Yannick: Could you put some usage examples about pats-filter in your git-hub  
directory? Such examples should make it a lot easier for users to figure  
out how  
to use pats-filter. Examples for other commands are welcome as well.

Cheers!On Thursday, December 31, 2015 at 7:10:27 PM UTC-5, Yannick Duchêne wrote:

> Le mercredi 30 décembre 2015 22:51:40 UTC+1, Kiwamu Okabe a écrit :
> 
> > It’s very useful! I tried to explain it at Wiki page.
> > 
> > [Error messages · githwxi/ATS-Postiats Wiki · GitHub](https://github.com/githwxi/ATS-Postiats/wiki/Error-messages#pretty-print-error-messages)
> > 
> > Thanks,
> 
> Thanks too :-p . I just editor the wilki page after a change in the  
> repository: I turned things into a package because I will add some other  
> things and it needed to be cleaner. Now the executable is a wrapper named  
> `pats-filter`.

---

<div class="post-metadata">

**Author:** ![steinwaywhw](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/steinwaywhw/32/2_2.png) [@steinwaywhw](https://discourse.ats-lang.org/u/steinwaywhw)\
**Post date:** [May 20, 2015, 1:24pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/8 "2015-05-20T13:24:21Z")

</div>

Actually the followings are more suitable.

make 2\>&1 | em “line=\d+” -f red | em “[\w+]” -f yellow | em “SHOWTYPE”  
-f blue

And this gives me something like the followings

patscc util/\*.dats parcc.dats -g -DATS\_MEMALLOC\_LIBC -o main -latslib -lm  
/home/hwwu/GitHub/ats-parcc/parcc.dats: 7588(line=235, offs=13) – 7636(  
line=235, offs=61): error(3): the symbol [show] cannot be resolved as no  
match is found.  
/home/hwwu/GitHub/ats-parcc/parcc.dats: 7674(line=237, offs=13) – 7723(  
line=237, offs=62): error(3): the symbol [show] cannot be resolved as no  
match is found.  
/home/hwwu/GitHub/ats-parcc/parcc.dats: 7761(line=239, offs=13) – 7808(  
line=239, offs=60): error(3): the symbol [show] cannot be resolved as no  
match is found.  
/home/hwwu/GitHub/ats-parcc/parcc.dats: 7846(line=241, offs=13) – 7894(  
line=241, offs=61): error(3)  
: the symbol [show] cannot be resolved as no match is found.

_em_ is a python utility, it can be installed via _pip3_ (need sudo to  
install to /usr/bin, or non-sudo but install to local bin)  
See: em.readthedocs.orgOn Monday, May 18, 2015 at 5:58:34 PM UTC-4, gmhwxi wrote:

> Could you show some typical output from using the following command-line?  
> I could not see any output on my console.
> 
> On Monday, May 18, 2015 at 12:26:34 PM UTC-4, Steinway Wu wrote:
> 
> > Translators could be great. But for simple cases, I just use pipe and ack.
> > 
> > make 2\>&1 | ack “([^/]\*.([sdhv]ats))|(line=\d+)”
> > 
> > On Sunday, May 17, 2015 at 5:02:47 PM UTC-4, gmhwxi wrote:
> > 
> > > Error messages issued by the typechecker of ATS containing strings  
> > > representing  
> > > abstract syntax trees. Such messages can be very informative but are  
> > > difficult to parse  
> > > (especially for beginners).
> > > 
> > > This thread is meant for people to discuss how “translators” can be  
> > > written so as to  
> > > make ATS error messages easier to access.

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [May 18, 2015, 2:35pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/9 "2015-05-18T14:35:07Z")

</div>

> A web form that you can copy and paste an error from patscc in and  
> choose various output/analysis options. Aside from pretty printing,  
> _it could possibly consult a database of errors and solutions/commentary_.
> 
> Of course, it would be great if these could be pulled from this  
> discussion group.

I already see one entry to add to this DB: sometime ATS complains about an  
unsolved constraint, while this is just that something was not instantiated  
while it should have been. I’ve seen it multiple times with universal  
quantification.

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [December 24, 2015, 8:53pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/10 "2015-12-24T20:53:26Z")

</div>

> Thanks!
> 
> It really helps. Quite a few students taking my programming classes  
> benefited from using it.

That’s nice 🙂

Please, if they use this new one, as I feel to remember they use Gedit,  
tell them to change the global flag `LOC_WITH_COLUMN` from `True` to  
`False`, as Gedit does not know about column numbers (I’m using this one  
with Sublime Text).

If they would like some expressions to be better printed, they can open an  
issue with a copy/paste of an example Postiat message they would like to be  
better handled.

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [December 24, 2015, 7:16pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/11 "2015-12-24T19:16:07Z")

</div>

Thanks!

It really helps. Quite a few students taking my programming classes  
benefited from using it.On Thu, Dec 24, 2015 at 2:03 PM, ‘Yannick Duchêne’ via ats-lang-users \< [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com)\> wrote:

> Le dimanche 17 mai 2015 23:02:47 UTC+2, gmhwxi a écrit :
> 
> > Error messages issued by the typechecker of ATS containing strings  
> > representing  
> > abstract syntax trees. Such messages can be very informative but are  
> > difficult to parse  
> > (especially for beginners).
> > 
> > This thread is meant for people to discuss how “translators” can be  
> > written so as to  
> > make ATS error messages easier to access.
> 
> I made one, better than a previous ugly one. This new one really parse the  
> message. It pretty print using multi‑line and indentation and  
> simplification of some expression. The simplification of expression is  
> likely to be updated and can be turned on with a global boolean flag. The  
> rest is likely to be rather stable. For now, it works best on messages from  
> the constraint solver, as this was initially my main issue. Other message  
> will be re‑formated, but not simplified (for now).
> 
> It search for expressions in message with location only. For each  
> expression found, it replace it with a placeholder (the three dots  
> character) and display the pretty printed expression below the message.
> 
> [GitHub - Hibou57/PostiATS-Utilities: Messages pretty printer, JSONized files cache and documentation utilities, for ATS/PostiATS (ATS2)](https://github.com/Hibou57/PostiATS-Messages-Filter)
> 
> I will populate the README file later.
> 
> I give two real cases examples to show how it can help.
> 
> This:  
> /home/yannick/Bureau/Logique/ATS/UTF\_8.dats: 16442(line=508, offs=26) –  
> 16444(line=508, offs=28): error(3): unsolved constraint: C3NSTRprop(  
> C3TKmain(); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst(||);  
> S2Eapp(S2Ecst(||); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst  
> (||); S2Eapp(S2Ecst(||); S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(0  
> ), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(127))),  
> S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(128), S2Evar(c(4157))),  
> S2Eapp(S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(2047)))), S2Eapp(S2Ecst(&&);  
> S2Eapp(S2Ecst(\<=); S2Eintinf(2048), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=);  
> S2Evar(c(4157)), S2Eintinf(4095)))), S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=);  
> S2Eintinf(4096), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(4157)),  
> S2Eintinf(53247)))), S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(53248  
> ), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(55295  
> )))), S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(57344), S2Evar(c(  
> 4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(65535)))), S2Eapp(  
> S2Ecst(&&); S2Eapp(S2Ecst(\<=); S2Eintinf(65536), S2Evar(c(4157))), S2Eapp(  
> S2Ecst(\<=); S2Evar(c(4157)), S2Eintinf(262143)))), S2Eapp(S2Ecst(&&);  
> S2Eapp(S2Ecst(\<=); S2Eintinf(262144), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=);  
> S2Evar(c(4157)), S2Eintinf(1048575)))), S2Eapp(S2Ecst(&&); S2Eapp(S2Ecst  
> (\<=); S2Eintinf(1048576), S2Evar(c(4157))), S2Eapp(S2Ecst(\<=); S2Evar(c(  
> 4157)), S2Eintinf(1114111)))))
> 
> Becomes this:  
> UTF\_8.dats:508:26: unsolved constraint: …  
> (  
> (  
> (  
> (  
> (  
> (  
> (  
> (((0 \<= c) && (c \<= 127)) || ((128 \<= c) && (c \<= 2047)))  
> || ((2048 \<= c) && (c \<= 4095))  
> )  
> || ((4096 \<= c) && (c \<= 53247))  
> )  
> || ((53248 \<= c) && (c \<= 55295))  
> )  
> || ((57344 \<= c) && (c \<= 65535))  
> )  
> || ((65536 \<= c) && (c \<= 262143))  
> )  
> || ((262144 \<= c) && (c \<= 1048575))  
> )  
> || ((1048576 \<= c) && (c \<= 1114111))  
> )
> 
> This:  
> /home/yannick/Bureau/Logique/ATS/test-21.dats: 562(line=21, offs=23) –  
> 564(line=21, offs=25): error(3): unsolved constraint: C3NSTRprop(C3TKmain  
> (); S2Eeqeq(S2Eintinf(1); S2Eapp(S2Ecst(sub\_int\_int); S2EVar(0-\>S2Eapp(  
> S2Ecst(sub\_int\_int); S2EVar(5), S2Eintinf(1))), S2Eintinf(1))))
> 
> Become this:  
> test-21.dats:21:23: unsolved constraint: …  
> (1 == (S2EVar(0 → (S2EVar(5) \* 1)) \* 1))
> 
> I tested it on a message posted by Artyom Shalkhakov:
> 
> His:  
> /home/admin/org/ats/lmacrodeftest.dats: 576(line=38, offs=12) – 611(line=  
> 38, offs=47): error(mac): the form of dynamic expression [D2Esing(  
> D2Eifhead(D2Emacfun(iscons; D2Evar(xs$3803(-1))); D2Emacsyn(MSKencode;  
> D2Eseq(D2Eapplst(D2Esym(print); D2EXPARGdyn(-1; D2Emacsyn(MSKdecode;  
> D2Emacfun(car; D2Evar(xs$3803(-1)))))), D2Emacsyn(MSKdecode; D2Eapplst(  
> D2Emac(auxlist); D2EXPARGdyn(-1; D2Emacfun(cdr; D2Evar(xs$3803(-1))),  
> D2Evar(y$3804(-1))))))); Some(D2Evar(y$3804(-1)))))] is unsupported for  
> macro expansion.
> 
> Become this:  
> …/…/…/…/admin/org/ats/lmacrodeftest.dats:38:12: the form of dynamic  
> expression […] is unsupported for macro expansion.  
> D2Esing(  
> D2Eifhead(  
> D2Emacfun(iscons; xs$3803);  
> D2Emacsyn(  
> MSKencode;  
> D2Eseq(  
> D2Eapplst(  
> D2Esym(print);  
> D2EXPARGdyn(-1; D2Emacsyn(MSKdecode; D2Emacfun(car; xs$3803)))  
> ),  
> D2Emacsyn(  
> MSKdecode;  
> D2Eapplst(  
> D2Emac(auxlist); D2EXPARGdyn(-1; D2Emacfun(cdr; xs$3803),  
> y$3804)  
> )  
> )  
> )  
> );  
> Some(y$3804)  
> )  
> )
> 
> .
> 
> –  
> 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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [https://groups.google.com/group/ats-lang-users](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/4b264fc6-2e32-4a1a-af49-58d763586a78%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/4b264fc6-2e32-4a1a-af49-58d763586a78%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/4b264fc6-2e32-4a1a-af49-58d763586a78%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/4b264fc6-2e32-4a1a-af49-58d763586a78%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [May 18, 2015, 9:58pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/12 "2015-05-18T21:58:34Z")

</div>

Could you show some typical output from using the following command-line?  
I could not see any output on my console.On Monday, May 18, 2015 at 12:26:34 PM UTC-4, Steinway Wu wrote:

> Translators could be great. But for simple cases, I just use pipe and ack.
> 
> make 2\>&1 | ack “([^/]\*.([sdhv]ats))|(line=\d+)”
> 
> On Sunday, May 17, 2015 at 5:02:47 PM UTC-4, gmhwxi wrote:
> 
> > Error messages issued by the typechecker of ATS containing strings  
> > representing  
> > abstract syntax trees. Such messages can be very informative but are  
> > difficult to parse  
> > (especially for beginners).
> > 
> > This thread is meant for people to discuss how “translators” can be  
> > written so as to  
> > make ATS error messages easier to access.

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [May 17, 2015, 9:32pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/13 "2015-05-17T21:32:03Z")

</div>

> Error messages issued by the typechecker of ATS containing strings  
> representing  
> abstract syntax trees. Such messages can be very informative but are  
> difficult to parse  
> (especially for beginners).
> 
> This thread is meant for people to discuss how “translators” can be  
> written so as to  
> make ATS error messages easier to access.

In another thread, a question raised: wrapper or pipe filter?

What abut a mix of both? Modular using pipe filters? The wrapper would  
manage pipes.

Filters are nice in that they follow the Unix principle: do one thing  
correctly. But they needs to be applied using pipes, and pipes are not so  
nice: you lose the exit code of the main program (the exit code is the one  
of the filter instead) and you have to handle stdout and stderr separately.  
This ends to require the use of temporary file and multiple redirection to  
and from temporary files.

The wrapper could handle all of the bad aspects of pipes while still  
relying and simple and technology neutral filters?

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [May 17, 2015, 10:01pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/14 "2015-05-17T22:01:00Z")

</div>

I think this will certainly be great for new users and hopefully  
others as well. A “filter” has the advantage of not changing the  
default but having something immediately available to new users (if  
they know about it, which I guess is the next best thing to a  
default).

Another possibility:

A web form that you can copy and paste an error from patscc in and  
choose various output/analysis options. Aside from pretty printing, it  
could possibly consult a database of errors and solutions/commentary.  
Of course, it would be great if these could be pulled from this  
discussion group.On Sun, May 17, 2015 at 5:32 PM, ‘Yannick Duchêne’ via ats-lang-users [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com) wrote:

> Le dimanche 17 mai 2015 23:02:47 UTC+2, gmhwxi a écrit :
> 
> > Error messages issued by the typechecker of ATS containing strings  
> > representing  
> > abstract syntax trees. Such messages can be very informative but are  
> > difficult to parse  
> > (especially for beginners).
> > 
> > This thread is meant for people to discuss how “translators” can be  
> > written so as to  
> > make ATS error messages easier to access.
> 
> In another thread, a question raised: wrapper or pipe filter?
> 
> What abut a mix of both? Modular using pipe filters? The wrapper would  
> manage pipes.
> 
> Filters are nice in that they follow the Unix principle: do one thing  
> correctly. But they needs to be applied using pipes, and pipes are not so  
> nice: you lose the exit code of the main program (the exit code is the one  
> of the filter instead) and you have to handle stdout and stderr separately.  
> This ends to require the use of temporary file and multiple redirection to  
> and from temporary files.
> 
> The wrapper could handle all of the bad aspects of pipes while still relying  
> and simple and technology neutral filters?
> 
> –  
> 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](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](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/44e17e03-4604-4f5c-8392-372434de61be%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/44e17e03-4604-4f5c-8392-372434de61be%40googlegroups.com).

Brandon Barker  
[brandon...@gmail.com](mailto:brandon...@gmail.com)

---

<div class="post-metadata">

**Author:** ![steinwaywhw](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/steinwaywhw/32/2_2.png) [@steinwaywhw](https://discourse.ats-lang.org/u/steinwaywhw)\
**Post date:** [May 18, 2015, 4:26pm UTC](https://discourse.ats-lang.org/t/patscc-pp/467/15 "2015-05-18T16:26:34Z")

</div>

Translators could be great. But for simple cases, I just use pipe and ack.

make 2\>&1 | ack "([^/]\*.([sdhv]ats))|(line=\d+)"On Sunday, May 17, 2015 at 5:02:47 PM UTC-4, gmhwxi wrote:

> Error messages issued by the typechecker of ATS containing strings  
> representing  
> abstract syntax trees. Such messages can be very informative but are  
> difficult to parse  
> (especially for beginners).
> 
> This thread is meant for people to discuss how “translators” can be  
> written so as to  
> make ATS error messages easier to access.
