Re: non-exhaustive pattern match in case+ expression

2020-10-17 Thread Hongwei Xi
Thanks for reporting it.

Finally got some time fixing this issue. Basically, records were not
handled. They are now handled.
The changes should go into the next release.

On Wed, Oct 14, 2020 at 5:48 AM Dambaev Alexander 
wrote:

> Hi,
> I have the following example:
> ```
> #include "share/atspre_define.hats"
> #include "share/atspre_staload.hats"
>
> #define ATS_DYNLOADFLAG 0
>
> implement main0() = {
>   val a = (Some_vt(0), None_vt())
>   val b =
> case+ a:(Option_vt(int), Option_vt(int)) of (* *9* *)
> | @( ~Some_vt(_), ~Some_vt(_)):(Option_vt(int), Option_vt(int)) => 0
> | @( ~Some_vt(_), ~None_vt()):(Option_vt(int), Option_vt(int)) => 1
> | @( ~None_vt(), ~Some_vt(_)):(Option_vt(int), Option_vt(int)) => 2
> | @( ~None_vt(), ~None_vt()):(Option_vt(int), Option_vt(int)) => 3 (*
> *13* *)
> }
> ```
> which produces the following error
> ```
> /data/devel/ats2/issue/main.dats: 172(line=9, offs=5) -- 503(line=13,
> offs=71): error(3): pattern match is nonexhaustive:
> @{0= Some_vt(_), 1= None_vt()}
> /data/devel/ats2/issue/main.dats: 172(line=9, offs=5) -- 503(line=13,
> offs=71): error(3): pattern match is nonexhaustive:
> @{0= None_vt()}
> typechecking has failed: there are some unsolved constraints: please
> inspect the above reported error message(s) for information.
> exit(ATS): uncaught exception:
> _2tmp_2ATS_2dPostiats_2src_2pats_error_2esats__FatalErrorExn(1025)
> ```
> I guess it is related to the same "weak type inference" thing, but type
> annotations are not helpful here. Replacing with '*case-*' helps, of
> course, but I would like to know how can I use case+ instead
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ats-lang-users/CAHjn2KzL02cZTA7CP_aWMet_Hk%2BtYkMxAAZgejcTjC3%2B36Y8ZA%40mail.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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrmyUxpzbuwsKF1b%3DCZN_kELm1iqxLenVN9R%2ByjhptX3Q%40mail.gmail.com.


Re: feature request: showing location of failed constraint

2020-10-17 Thread Hongwei Xi
Have already kept a note of this request.


On Fri, Oct 2, 2020 at 9:13 AM Dambaev Alexander 
wrote:

> Hi,
>
> I found, that it is difficult to locate constraint, that had been failed
> to be solved.
> For example, I got error message like this:
> ```
> /data/devel/ats2/bytestring/DATS/bytestring_flat.dats: 12395(line=442,
> offs=49) -- 12409(line=442, offs=63): error(3): unsolved constraint:
> C3NSTRprop(C3TKmain(); S2Eapp(S2Ecst(>=); S2EVar(5829), S2Eintinf(0)))
> ```
>
> which shows me where the constraint failed to be satisfied, but does not
> shows which constraint I need to debug.
> In this particular case, there are 11 lines of constraints for me and I
> required to be very careful to found which one had issue.
>
> I hope, that at least ATS3 will be able to provide location of constraint
> definition to debug
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ats-lang-users/CAHjn2KzZuP5E3yiaoaTVFSN9Wng-QGrWOMJjt_w0pf_eKePJLw%40mail.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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqdLxkjFYxAtKDx4705Ek4yV5Wj1rdTM3gZ5RZKDhjV_w%40mail.gmail.com.


Re: Current Status of ATS3

2020-10-17 Thread Brandon Barker
Thanks for your continued efforts! That all sounds wonderful, just one 
question for now: it sounds like ATS3-ML's first working target will be 
Javascript. I wonder if ATS3-ML is similar enough to some existing ML to 
support an ML target? Or maybe I misunderstood and the ML target can 
already be executed standalone.

On Tuesday, September 1, 2020 at 12:52:11 PM UTC-4 gmhwxi wrote:

>
> Hi, there,
>
> I would like to say a few words on the current status of ATS3.
>
> Originally, I planned to complete a compiler from ATS3 to C/C++ by
> the end of Summer, 2020. On the way, my plan changed somewhat.
> This is the current status of ATS3:
>
> 1. In the following repository, there is a compiler from ATS3 to an 
> intermediate
> language ATS3-ML (which is ML-like):
>
> https://github.com/githwxi/ATS-Xanadu
>
> This compiler is functioning. And it will be polished and improved 
> gradually. This
> is the core for all of the future development of ATS3. Essentially, the 
> compiler first
> does the so-called Hindley-style of type-inference, and then it performs 
> template resolution.
>
> 2. In the following repository, there is a running interpreter for testing 
> the aforementioned
> compiler:
>
> https://github.com/xanadu-lang/xinterp
>
> This interpreter is not meant for practical use; it is mainly for testing 
> and documenting
> the syntax of ATS3.
>
> 3. I am working on a compiler from ATS3-ML to JS:
>
> https://github.com/xanadu-lang/xats2js
>
> This compiler is meant for practical use. For instance, I plan to use it 
> for building a website for ATS3. Hopefully, this compiler will be 
> functioning in a couple of months.
>
> After xats2js, I will be working on dependent and linear type-checking for 
> ATS3 and then
> a compiler from ATS-ML to C/C++. Will keep everyone informed.
>
> Cheers,
>
> --Hongwei
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/b44430c7-7ed0-4761-aac5-8c1c193f1439n%40googlegroups.com.


Re: feature request: showing location of failed constraint

2020-10-17 Thread Dambaev Alexander
Glad to hear that: this makes fixing such issues much more faster

сб, 17 окт. 2020 г. в 15:57, Hongwei Xi :

> Have already kept a note of this request.
>
>
> On Fri, Oct 2, 2020 at 9:13 AM Dambaev Alexander 
> wrote:
>
>> Hi,
>>
>> I found, that it is difficult to locate constraint, that had been failed
>> to be solved.
>> For example, I got error message like this:
>> ```
>> /data/devel/ats2/bytestring/DATS/bytestring_flat.dats: 12395(line=442,
>> offs=49) -- 12409(line=442, offs=63): error(3): unsolved constraint:
>> C3NSTRprop(C3TKmain(); S2Eapp(S2Ecst(>=); S2EVar(5829), S2Eintinf(0)))
>> ```
>>
>> which shows me where the constraint failed to be satisfied, but does not
>> shows which constraint I need to debug.
>> In this particular case, there are 11 lines of constraints for me and I
>> required to be very careful to found which one had issue.
>>
>> I hope, that at least ATS3 will be able to provide location of constraint
>> definition to debug
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ats-lang-users/CAHjn2KzZuP5E3yiaoaTVFSN9Wng-QGrWOMJjt_w0pf_eKePJLw%40mail.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-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLqdLxkjFYxAtKDx4705Ek4yV5Wj1rdTM3gZ5RZKDhjV_w%40mail.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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAHjn2KxqS5Nk%2BGzPLa-05u5ogoaNPGYunA1Be6LiYUkjCaPhow%40mail.gmail.com.


Re: Current Status of ATS3

2020-10-17 Thread Dambaev Alexander
On Tuesday, September 1, 2020 at 12:52:11 PM UTC-4 gmhwxi wrote:
>
>>
>> Hi, there,
>>
>> I would like to say a few words on the current status of ATS3.
>>
>> Originally, I planned to complete a compiler from ATS3 to C/C++ by
>> the end of Summer, 2020. On the way, my plan changed somewhat.
>> This is the current status of ATS3:
>>
>> 1. In the following repository, there is a compiler from ATS3 to an
>> intermediate
>> language ATS3-ML (which is ML-like):
>>
>> https://github.com/githwxi/ATS-Xanadu
>>
>> This compiler is functioning. And it will be polished and improved
>> gradually. This
>> is the core for all of the future development of ATS3. Essentially, the
>> compiler first
>> does the so-called Hindley-style of type-inference, and then it performs
>> template resolution.
>>
>> 2. In the following repository, there is a running interpreter for
>> testing the aforementioned
>> compiler:
>>
>> https://github.com/xanadu-lang/xinterp
>>
>> This interpreter is not meant for practical use; it is mainly for testing
>> and documenting
>> the syntax of ATS3.
>>
>> 3. I am working on a compiler from ATS3-ML to JS:
>>
>> https://github.com/xanadu-lang/xats2js
>>
>> This compiler is meant for practical use. For instance, I plan to use it
>> for building a website for ATS3. Hopefully, this compiler will be
>> functioning in a couple of months.
>>
>> After xats2js, I will be working on dependent and linear type-checking
>> for ATS3 and then
>> a compiler from ATS-ML to C/C++. Will keep everyone informed.
>>
>> Cheers,
>>
>> --Hongwei
>>
>>
>>
>> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ats-lang-users/b44430c7-7ed0-4761-aac5-8c1c193f1439n%40googlegroups.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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAHjn2Ky%3DAJD%2B63VeMFhZdc0g98HWx9d4nqvm11%3DqfyRX%3DgrCAQ%40mail.gmail.com.


Re: Current Status of ATS3

2020-10-17 Thread Dambaev Alexander
Thanks for the report. I think all of us can't  wait to try ATS3,
especially if it will improve user-experience in comparison to ATS2.

As I guess, "someone" can try to work on ATS3-ML->C/C++ translator in
parallel to xats2js at the point, when ATS3-ML should not have planned
backward incompatibility changes.
Am I correct: ATS3-ML, being intermediate language, does not aware of
dependent/linear types and

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAHjn2KxKWJc%3DA3zFfzL3WNcr1F3rO_b_as0yKU6pcc4MwNOCAA%40mail.gmail.com.


Re: Current Status of ATS3

2020-10-17 Thread Dambaev Alexander
Thanks for the report. I think all of us can't  wait to try ATS3,
especially if it will improve user-experience in comparison to ATS2.

As I guess, "someone" can try to work on ATS3-ML->C/C++ translator in
parallel to xats2js at the point, when ATS3-ML should not have planned
backward incompatibility changes.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAHjn2KxVhDQ_UL3nkc_6SPbAh-Xn%2BFnmcgh9eWNfYie6UCW4pg%40mail.gmail.com.


Re: Current Status of ATS3

2020-10-17 Thread Dambaev Alexander
Thanks for the report. I think all of us can't  wait to try ATS3,
especially if it will improve user-experience in comparison to ATS2.

As I guess, "someone" can try to work on ATS3-ML->C/C++ translator in
parallel to xats2js at the point, when ATS3-ML should not have planned
backward incompatibility changes.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAHjn2Kxymubn0KnZC9_3Wtf19OdKgCxTb8eV8xrbeSjkvQp7Qg%40mail.gmail.com.