An ATS mode for SublimeText and TextMate

184 views
Skip to first unread message

Steinway Wu

unread,
Dec 5, 2013, 11:12:03 PM12/5/13
to ats-lan...@googlegroups.com
Hello, 


This is a very ugly ats mode for sublimetext, but at least it is better than nothing. Hopefully it will make you a little bit happier if you are using sublimetext. Also, I believe it should work with textmate, too. 

And you are welcome to modify or contribute to it. 

Thank you!

Brandon Barker

unread,
Jan 11, 2015, 1:29:46 AM1/11/15
to Steinway Wu, ats-lang-users
It might be fun to have some version of this put in a place (not sure which place yet, but presumably upstream somewhere) where github's linguist will be able to find it: https://github.com/github/linguist

Then, we can have proper source highlighting for ATS on github. 



--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/aa687715-10b2-4e28-b6d8-d4c3013f0f16%40googlegroups.com.



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

Steinway Wu

unread,
Jan 26, 2015, 10:52:26 AM1/26/15
to ats-lan...@googlegroups.com
Good idea! I think @Will Blair has done that? I'm not sure but I will take a look. If needed I will do that.

Brandon Barker

unread,
Jan 26, 2015, 11:04:52 AM1/26/15
to ats-lang-users
If we're thinking of the same thing, Will worked on ATS source recognition in github, but the highlighter is set to ocaml currently (iirc).

Yannick Duchêne

unread,
Jan 28, 2015, 5:00:52 PM1/28/15
to ats-lan...@googlegroups.com


Le vendredi 6 décembre 2013 05:12:03 UTC+1, Steinway Wu a écrit :
Hello, 


This is a very ugly ats mode for sublimetext, but at least it is better than nothing. […]

Better than nothing too, is the language definition file added as attachment to this message, I'm using for GtkSourceView based editors (Gedit and rather Medit, actually). I'm also adding the MIME type definition and icon file to be used by people running a Freedesktop aware environment.

The language definition file is subject to change, as I'm incrementally updating and refining it, but as this thread shown up, I'm posting it here (it's not perfect, but good enough).

Note: I'm using a slightly modified Solarized Dark theme, and I have not check the language definition looks good with other themes.

ats.lang
ats.xml
ats.svg

gmhwxi

unread,
Jan 28, 2015, 5:29:03 PM1/28/15
to ats-lan...@googlegroups.com
Thanks!

It is much more than nothing :)

Once you can highlight keywords, I would say that it is 90% done.

gmhwxi

unread,
Jan 28, 2015, 7:43:55 PM1/28/15
to ats-lan...@googlegroups.com
I tried it. It looks good.

I will recommend it to the students taking my programming language class
next week.

Do you happen to have an on-line place to put all these files? E.g., Github?
If you do, then I can mention the link on the following page:

http://www.ats-lang.org/Resources.html

Cheers!


On Wednesday, January 28, 2015 at 5:00:52 PM UTC-5, Yannick Duchêne wrote:

Yannick Duchêne

unread,
Jan 29, 2015, 4:27:02 AM1/29/15
to ats-lan...@googlegroups.com
Will think of it today, and create an archive of files with instructions for installation.

Yannick Duchêne

unread,
Jan 29, 2015, 2:20:39 PM1/29/15
to ats-lan...@googlegroups.com


Le jeudi 29 janvier 2015 01:43:55 UTC+1, gmhwxi a écrit :
I tried it. It looks good.

I will recommend it to the students taking my programming language class
next week.

Do you happen to have an on-line place to put all these files? E.g., Github?
If you do, then I can mention the link on the following page:

Hongwei Xi

unread,
Jan 29, 2015, 2:25:14 PM1/29/15
to ats-lan...@googlegroups.com
Thanks!

Could you add an item about this in the following file
and then issue a git-pull request:

https://github.com/githwxi/ATS-Postiats/blob/master/doc/PROJECT/MEDIUM/ats2langweb/thePageRBodyRight/Resources.php

I will mention it to the students taking my CS520 class next week. I know some of them will be very happy because they use gedit :)

Cheers!



--
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.

Steinway Wu

unread,
Jan 30, 2015, 1:34:40 PM1/30/15
to ats-lan...@googlegroups.com
@Brandon Barker, I've issued pull request to github/linguist, please see https://github.com/github/linguist/pull/2057. Hope we can see better highlight shortly.


On Sunday, January 11, 2015 at 1:29:46 AM UTC-5, Brandon Barker wrote:

gmhwxi

unread,
Jan 30, 2015, 1:54:39 PM1/30/15
to ats-lan...@googlegroups.com

Thanks for your effort!

Based on our past experience, we may have to nag/bug to get this in :)

Brandon Barker

unread,
Jan 30, 2015, 4:47:15 PM1/30/15
to ats-lang-users
Great, looking forward to it! But yes, as Hongwei pointed out as well, I am prepared to wait a while and possibly give it a nudge after a few days.

Brandon Barker

unread,
Jan 31, 2015, 8:51:24 PM1/31/15
to ats-lang-users
re: the github thread, do we actually want to remove atxt - is it being deprecated?
--
Brandon Barker
brandon...@gmail.com

gmhwxi

unread,
Jan 31, 2015, 11:13:20 PM1/31/15
to ats-lan...@googlegroups.com
Atext files are still in active use.

There is just no plan to improve the handling of Atext files.

Brandon Barker

unread,
Feb 1, 2015, 5:11:32 PM2/1/15
to ats-lang-users
It seems that the ocaml highligher still does a reasonable job of coloring atxt files:

I assume that using the ATS highlighter would be similar.

gmhwxi

unread,
Feb 1, 2015, 5:54:07 PM2/1/15
to ats-lan...@googlegroups.com
Well, this is due to the .atxt file you used containing mostly code.

For instance, syntax-highlighting does not really work for the following one:

https://github.com/githwxi/ATS-Postiats/blob/master/doc/BOOK/INT2PROGINATS/CHAP_ABSVTYPE/main.atxt

Brandon Barker

unread,
Feb 1, 2015, 6:11:05 PM2/1/15
to ats-lang-users
Yes, that one is not so nice. 

Yannick Duchêne

unread,
May 15, 2015, 10:28:05 AM5/15/15
to ats-lan...@googlegroups.com
It's just been updated: I had a feeling proper colorization for extern blocks was really needed. Explanations about how to use it, is given in the README.md file (for short, it use a language tag as a comment just before the extern block).


Yannick Duchêne

unread,
May 17, 2015, 1:04:00 AM5/17/15
to ats-lan...@googlegroups.com


Le jeudi 29 janvier 2015 20:20:39 UTC+1, Yannick Duchêne a écrit :
I added a tiny utility to reformat messages from ATS. This may be useful to messages pans of editors which has the capability to run external tools (I use it with MEdit, alias MooEdit) . My apologizes for not releasing as ATS, which may be done a future day (the Python source does not make use of regexp, on purpose).

Instructions for use and what re‑formating is applied, is explained in the file it‑self:

Message has been deleted

Yannick Duchêne

unread,
May 17, 2015, 4:05:44 PM5/17/15
to ats-lan...@googlegroups.com


Le dimanche 17 mai 2015 07:04:00 UTC+2, Yannick Duchêne a écrit :

I added a tiny utility to reformat messages from ATS. This may be useful to messages pans of editors which has the capability to run external tools (I use it with MEdit, alias MooEdit) . My apologizes for not releasing as ATS, which may be done a future day (the Python source does not make use of regexp, on purpose).

Instructions for use and what re‑formating is applied, is explained in the file it‑self:


I'm interested in comments on additional re‑formating I would like to add. I would like to specifically re‑format message from `showtype`, displaying things like `S2Ecst(false_bool)` as `false`, empty predicate `; ;` as `true`, application like in `S2Eapp(S2Ecst(set); S2Evar(s))` as something like `(cst-set var-s)` or may be `cst-set(var-s)`, writing `∃` instead of `S2Eexi` and `∀` instead of `S2Euni`, added indentation for nested expressions, things like that. Note there are already some dirty and simple re-formating apply, I'm talking about further re-formating.

I have a doubt, I feel it may be nice, while in the mean time, I'm afraid this would be too far from the real messages from ATS and JSON output, so that it may disturb more than it would help.

In your opinion: would this help or would this disturb?

Or may be a supplementary filter to be explicitly applied on showtype's output expressions would be better? I mean, something like “copy/paste, then invoke a filter to reformat”. 

gmhwxi

unread,
May 17, 2015, 4:51:00 PM5/17/15
to ats-lan...@googlegroups.com
For now, I think focusing on showtype messages would be a good idea.

Could you make a wrapper, say, patscc-pp for patscc?  I use pp to refers to
pretty-printing.

If one runs patscc-pp, then one should be able to see prettified warning/error messages.
In this way, everyone using ATS could benefit.

Of course, patscc-pp should be modular in the sense that the way that message prettifying
is done can be readily customized.

Yannick Duchêne

unread,
May 17, 2015, 5:24:08 PM5/17/15
to ats-lan...@googlegroups.com


Le dimanche 17 mai 2015 22:51:00 UTC+2, gmhwxi a écrit :
For now, I think focusing on showtype messages would be a good idea.


I entirely agree!
 
Could you make a wrapper, say, patscc-pp for patscc?  I use pp to refers to
pretty-printing.

If one runs patscc-pp, then one should be able to see prettified warning/error messages.
In this way, everyone using ATS could benefit.

I had a wrapper in mind too, but though a pipe filter may be more easy to use. I will look at the other thread, about patscc-pp. Otherwise, yes, a wrapper is a good idea.

Yannick Duchêne

unread,
May 17, 2015, 6:16:56 PM5/17/15
to ats-lan...@googlegroups.com


Le dimanche 17 mai 2015 22:05:44 UTC+2, Yannick Duchêne a écrit :

I'm interested in comments on additional re‑formating I would like to add. I would like to specifically re‑format message from `showtype`, displaying things like `S2Ecst(false_bool)` as `false`, empty predicate `; ;` as `true`, application like in `S2Eapp(S2Ecst(set); S2Evar(s))` as something like `(cst-set var-s)` or may be `cst-set(var-s)`, writing `∃` instead of `S2Eexi` and `∀` instead of `S2Euni`, added indentation for nested expressions, things like that. Note there are already some dirty and simple re-formating apply, I'm talking about further re-formating.

For now, here is a sample output (not on Github, only at home):

 
test.dats:113:5:
   error
(3):
   unsolved constraint
:
   
Prop(main; @(==; 1; 0))
typechecking has failed
:
there are some unsolved constraints
:
please inspect the above reported error message
(s) for information.
exit(ATS):
uncaught exception
:
[…]_error_2esats__FatalErrorExn(1025)
test
.dats:86:9:
   
@(cst-set; var-s):
   S2RTbas
(S2RTBASimp(1; t@ype))
test
.dats:90:9:
   
∃(s; ⊤; @(cst-set; var-s)):
   S2RTbas
(S2RTBASimp(1; t@ype))
test
.dats:91:9:
   
@(cst-set; var-s):
   S2RTbas
(S2RTBASimp(1; t@ype))
test
.dats:96:9:
   
∀(i(4335); ⊤; cst-set):
   S2RTbas
(S2RTBASimp(1; t@ype))
test
.dats:101:9:
   
∀(i; ⊤; ∃(s; ⊤; @(cst-set; var-s))):
   S2RTbas
(S2RTBASimp(1; t@ype))
test
.dats:106:9:
   
∀(i; ⊤; @(cst-set; var-s)):
   S2RTbas
(S2RTBASimp(1; t@ype))
test
.dats:111:9:
   
∀(i; @(cst-~; @(cst-has; var-s, var-i)); @(cst-set; var-s)):
   S2RTbas
(S2RTBASimp(1; t@ype))

Here is the original unfiltered output, for comparison:
/home/yannick/Bureau/RenderMan/html/calc-ats/test.dats: 3387(line=113, offs=5) -- 3395(line=113, offs=13): error(3): unsolved constraint: C3NSTRprop(main; S2Eeqeq(S2Eintinf(1); S2Eintinf(0)))
typechecking has failed
: there are some unsolved constraints: please inspect the above reported error message(s) for information.
exit(ATS): uncaught exception: _2home_2hwxi_2research_2Postiats_2git_2src_2pats_error_2esats__FatalErrorExn(1025)
**SHOWTYPE[UP]**(/home/yannick/Bureau/RenderMan/html/calc-ats/test.dats: 2820(line=86, offs=9) -- 2830(line=86, offs=19)): S2Eapp(S2Ecst(set); S2Evar(s$1078(4464))): S2RTbas(S2RTBASimp(1; t@ype))
**SHOWTYPE[UP]**(/home/yannick/Bureau/RenderMan/html/calc-ats/test.dats: 2893(line=90, offs=9) -- 2911(line=90, offs=27)): S2Eexi(s$1081(4467); ; S2Eapp(S2Ecst(set); S2Evar(s$1081(4467)))): S2RTbas(S2RTBASimp(1; t@ype))
**SHOWTYPE[UP]**(/home/yannick/Bureau/RenderMan/html/calc-ats/test.dats: 2920(line=91, offs=9) -- 2930(line=91, offs=19)): S2Eapp(S2Ecst(set); S2Evar(s$1079$1080(4466))): S2RTbas(S2RTBASimp(1; t@ype))
**SHOWTYPE[UP]**(/home/yannick/Bureau/RenderMan/html/calc-ats/test.dats: 3021(line=96, offs=9) -- 3031(line=96, offs=19)): S2Euni(i(4335); ; S2Ecst(set)): S2RTbas(S2RTBASimp(1; t@ype))
**SHOWTYPE[UP]**(/home/yannick/Bureau/RenderMan/html/calc-ats/test.dats: 3133(line=101, offs=9) -- 3143(line=101, offs=19)): S2Euni(i$1084(4470); ; S2Eexi(s$1085(4471); ; S2Eapp(S2Ecst(set); S2Evar(s$1085(4471))))): S2RTbas(S2RTBASimp(1; t@ype))
**SHOWTYPE[UP]**(/home/yannick/Bureau/RenderMan/html/calc-ats/test.dats: 3245(line=106, offs=9) -- 3255(line=106, offs=19)): S2Euni(i$1087$1089(4475); ; S2Eapp(S2Ecst(set); S2Evar(s$1086$1088(4474)))): S2RTbas(S2RTBASimp(1; t@ype))
**SHOWTYPE[UP]**(/home/yannick/Bureau/RenderMan/html/calc-ats/test.dats: 3370(line=111, offs=9) -- 3380(line=111, offs=19)): S2Euni(i$1091$1093(4479); S2Eapp(S2Ecst(~); S2Eapp(S2Ecst(has); S2Evar(s$1090$1092(4478)), S2Evar(i$1091$1093(4479)))); S2Eapp(S2Ecst(set); S2Evar(s$1090$1092(4478)))): S2RTbas(S2RTBASimp(1; t@ype))


Yannick Duchêne

unread,
Dec 24, 2015, 1:50:24 PM12/24/15
to ats-lang-users


Le dimanche 17 mai 2015 07:04:00 UTC+2, Yannick Duchêne a écrit :

I added a tiny utility to reformat messages from ATS. This may be useful to messages pans of editors which has the capability to run external tools (I use it with MEdit, alias MooEdit) . My apologizes for not releasing as ATS, which may be done a future day (the Python source does not make use of regexp, on purpose).

Instructions for use and what re‑formating is applied, is explained in the file it‑self:


Please, don't use this filter. It was ugly and is now obsolete. I have now a repository for another better one.
 
Reply all
Reply to author
Forward
0 new messages