ats-lang-users Mailing List for The ATS PL System (Page 3)
Unleashing the potentials of types and templates
Status: Beta
Brought to you by:
ats-hwxi
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(18) |
Oct
(20) |
Nov
(13) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(51) |
Feb
(10) |
Mar
(1) |
Apr
(13) |
May
(11) |
Jun
(7) |
Jul
(14) |
Aug
|
Sep
(6) |
Oct
(18) |
Nov
(24) |
Dec
(18) |
2010 |
Jan
(4) |
Feb
(19) |
Mar
(8) |
Apr
(34) |
May
(27) |
Jun
(28) |
Jul
(12) |
Aug
(82) |
Sep
(21) |
Oct
(56) |
Nov
(41) |
Dec
(27) |
2011 |
Jan
(32) |
Feb
(34) |
Mar
(12) |
Apr
(102) |
May
(31) |
Jun
(12) |
Jul
(14) |
Aug
(17) |
Sep
(113) |
Oct
(46) |
Nov
(16) |
Dec
(61) |
2012 |
Jan
(72) |
Feb
(41) |
Mar
(43) |
Apr
(19) |
May
(9) |
Jun
(16) |
Jul
(27) |
Aug
|
Sep
(41) |
Oct
(3) |
Nov
(38) |
Dec
(47) |
2013 |
Jan
(27) |
Feb
(59) |
Mar
(12) |
Apr
(39) |
May
(34) |
Jun
(62) |
Jul
(17) |
Aug
(8) |
Sep
(36) |
Oct
(3) |
Nov
(12) |
Dec
(19) |
2014 |
Jan
(6) |
Feb
(5) |
Mar
(43) |
Apr
(35) |
May
(32) |
Jun
(1) |
Jul
(15) |
Aug
(61) |
Sep
(7) |
Oct
(60) |
Nov
(16) |
Dec
(18) |
2015 |
Jan
(26) |
Feb
(13) |
Mar
(12) |
Apr
(10) |
May
(17) |
Jun
(29) |
Jul
(18) |
Aug
(11) |
Sep
(4) |
Oct
(26) |
Nov
(13) |
Dec
(1) |
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2017 |
Jan
(2) |
Feb
(5) |
Mar
(1) |
Apr
(3) |
May
(6) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2018 |
Jan
(1) |
Feb
(1) |
Mar
(4) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
|
2021 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Hongwei Xi <hw...@bu...> - 2016-05-14 10:29:24
|
Hi, I am glad to announce the release of ATS2-0.2.7. This is the 30th release of ATS2, the successor of the ATS (currently referred to as ATS1) programming language. The compiler for ATS2 is given the name ATS/Positats, ATS2/Postiats or simply Postiats. ###### The official website for ATS is: http://www.ats-lang.org ATS-Postiats is hosted at github: https://github.com/githwxi/ATS-Postiats Major releases of ATS2 are available at: https://sourceforge.net/projects/ats2-lang/ Major releases of external packages for ATS2 are available at: https://sourceforge.net/projects/ats2-lang-contrib/ A google-group for discussing ATS and related issues is at: https://groups.google.com/forum/?fromgroups#!forum/ats-lang-users ###### The following packages are included in this release: ATS2-Postiats-0.2.7.tgz # requiring libgmp ATS2-Postiats-contrib-0.2.7.tgz # contributed packages ATS2-Postiats-include-0.2.7.tgz # CATS-files w/ BSD-like license I have included ATS2-Postiats-contrib (instead of releasing it separately) as it is truly by now an indispensible part of ATS2. After installing ATS-Postiats-include, one can compile the C code generated from ATS source without installing the ATS compiler. So a convenient way to distribute software written in ATS is to simply release the C code generated from the ATS source. See below for some major additions and changes since the last release (ATS2-0.2.6). ###### Cheers, --Hongwei Xi Computer Science Department Boston University 111 Cummington Street Boston, MA 02215 Email: hw...@cs... Url: http://www.cs.bu.edu/~hwxi Tel: +1 617 358 2511 (office) Fax: +1 617 353 6457 (department) ###### 1. Adding some basic functions into libats/ML/stdlib 2. Atexting is functioning; it has been used to syntax-hilite ATS code in docbook. 3. Refactoring libatsynmark to make it directly dependent on libatsopt 4. Automatically building libatsopt and libatsynmark when testing (travis-ci) 5. Automatically building INT2PROGINATS and ATS2TUTORIAL (thanks to Kiwamu Okabe) 6. Fixing bug-2016-05-13 involving pattern matching (see BUGs/bug-2016-05-13.dats) |
From: Hongwei Xi <hw...@bu...> - 2016-02-06 21:15:58
|
Hi, I am glad to announce the release of ATS2-0.2.6. This is the 29th release of ATS2, the successor of the ATS (currently referred to as ATS1) programming language. The compiler for ATS2 is given the name ATS/Positats, ATS2/Postiats or simply Postiats. ###### The official website for ATS is: http://www.ats-lang.org ATS-Postiats is hosted at github: https://github.com/githwxi/ATS-Postiats Major releases of ATS2 are available at: https://sourceforge.net/projects/ats2-lang/ Major releases of external packages for ATS2 are available at: https://sourceforge.net/projects/ats2-lang-contrib/ A google-group for discussing ATS and related issues is at: https://groups.google.com/forum/?fromgroups#!forum/ats-lang-users ###### The following packages are included in this release: ATS2-Postiats-0.2.6.tgz # requiring libgmp ATS2-Postiats-contrib-0.2.6.tgz # contributed packages ATS2-Postiats-include-0.2.6.tgz # CATS-files w/ BSD-like license I have included ATS2-Postiats-contrib (instead of releasing it separately) as it is truly by now an indispensible part of ATS2. After installing ATS-Postiats-include, one can compile the C code generated from ATS source without installing the ATS compiler. So a convenient way to distribute software written in ATS is to simply release the C code generated from the ATS source. See below for some major additions and changes since the last release (ATS2-0.2.5). ###### Cheers, --Hongwei Xi Computer Science Department Boston University 111 Cummington Street Boston, MA 02215 Email: hw...@cs... Url: http://www.cs.bu.edu/~hwxi Tel: +1 617 358 2511 (office) Fax: +1 617 353 6457 (department) ###### Here is a list of major additions and changes since the last release: 1. A minor fix to make the long form of macrodef work 2. Adding an article in EFFECTIVATS on parsing combinators of CPS-style 3. Allowing recursive evaluation of a file path: pkgsrcname_eval 4: Adding a section on linear C-strings in INT2PROGINATS 5: Adding an ATS2TUTORIAL-chapter on stack-allocated closure-functions 6: Adding support for #pragma(location, ...) (referred to as locpragma) 7. Adding an article in EFFECTIVATS on imperative vs. functional vs. linear functional |
From: Hongwei Xi <hw...@bu...> - 2015-12-23 04:14:31
|
Hi, I am glad to announce the release of ATS2-0.2.5. This is the 28th release of ATS2, the successor of the ATS (currently referred to as ATS1) programming language. The compiler for ATS2 is given the name ATS/Positats, ATS2/Postiats or simply Postiats. ###### The official website for ATS is: http://www.ats-lang.org ATS-Postiats is hosted at github: https://github.com/githwxi/ATS-Postiats Major releases of ATS2 are available at: https://sourceforge.net/projects/ats2-lang/ Major releases of external packages for ATS2 are available at: https://sourceforge.net/projects/ats2-lang-contrib/ A google-group for discussing ATS and related issues is at: https://groups.google.com/forum/?fromgroups#!forum/ats-lang-users ###### The following packages are included in this release: ATS2-Postiats-0.2.5.tgz # requiring libgmp ATS2-Postiats-contrib-0.2.5.tgz # contributed packages ATS2-Postiats-include-0.2.5.tgz # CATS-files w/ BSD-like license I have included ATS2-Postiats-contrib (instead of releasing it separately) as it is truly by now an indispensible part of ATS2. After installing ATS-Postiats-include, one can compile the C code generated from ATS source without installing the ATS compiler. So a convenient way to distribute software written in ATS is to simply release the C code generated from the ATS source. See below for some major additions and changes since the last release (ATS2-0.2.4). ###### Cheers, --Hongwei Xi Computer Science Department Boston University 111 Cummington Street Boston, MA 02215 Email: hw...@cs... Url: http://www.cs.bu.edu/~hwxi Tel: +1 617 358 2511 (office) Fax: +1 617 353 6457 (department) ###### Here is a list of major additions and changes since the last release: ###### 1. With libatscc2js(JS), Atscc2js can now run entirely inside the browser. 2. Patsopt(JS) and Atscc2js(JS) have been combined to allow one to try ATS entirely in one's browser (running only client-side JS). 3. Treating the following form as a value: let ... in aValue end (where aValue is assumed to be a value). 4. WebWorker-based support for session types in libatscc2js/Worker/channel 5. Fixing the handling of decarg of a function template declaration 6. Fixing a bug in effect-tracking of assignment: assigning a proof term should not genereate any effect. Please see: d2exp_trup_assgn:D2LVALvar_mut 7. Adding libats/ML/gvalue 8. Adding libats/ML/dynarray 9. Adding an ATS2TUTORIAL-chapter on boxed tuples and records. 10. Adding an article in EFFECTIVATS on encoding propositional logic 11. Removing the once planned support for flattened references (ref@) |
From: Kiwamu O. <ki...@de...> - 2015-11-15 13:44:52
|
I make own prelude for the ESP8266 platform: https://github.com/fpiot/esp8266-ats/tree/ats/ESP8266_PRELUDE https://github.com/fpiot/esp8266-ats/blob/ats/Makefile.common#L42 The compile option is wrong? ``` ATSCFLAGS += -D_ATSTYPE_VAR_SIZE_=0X000F -D_ATS_CCOMP_EXCEPTION_NONE_ -D_ATS_CCOMP_RUNTIME_NONE_ -D_ATS_CCOMP_PRELUDE_NONE_ -D_ATS_CCOMP_PRELUDE_USER_=\"../../ESP8266_PRELUDE/kernel_prelude.cats\" ``` -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-11-15 13:26:50
|
Hi all, Now, I'm porting ATS programming environment into tiny chip named ESP8266. https://github.com/fpiot/esp8266-ats And I'm trying to use strptr on the platform. ``` $ vi esp8266-ats/ESP8266_PRELUDE/CATS/memalloc.cats #ifndef ATSLIB_PRELUDE_CATS_MEMALLOC #define ATSLIB_PRELUDE_CATS_MEMALLOC void atsruntime_mfree_undef (void *ptr) { os_free(ptr); return; } void *atsruntime_malloc_undef (size_t bsz) { return ((void *)os_malloc(bsz)); } #endif // ifndef ATSLIB_PRELUDE_CATS_MEMALLOC $ vi esp8266-ats/ESP8266_PRELUDE/kernel_prelude.cats --snip-- #include "ESP8266_PRELUDE/CATS/memalloc.cats" $ vi esp8266-ats/dweet_ats/user/user_main.dats --snip-- implement tcp_connected (arg) = { val temperature = 55 (* test data *) val conn = $UN.cast{cPtr1(espconn_t)}(arg) val () = println! "tcp_connected()" val _ = espconn_regist_recvcb (conn, data_received) val json_data = string0_append ("{\"temperature\": ", "") val () = free json_data --snip-- ``` However the code occurs following compile error: ``` $ cd esp8266-ats/dweet_ats $ make ATS user/user_main.dats CC build/user/user_main_dats.c In file included from build/user/user_main_dats.c:15:0: build/user/user_main_dats.c: In function 'ATSLIB_056_prelude__string1_append__5__1': /home/kiwamu/src/ATS-Postiats/ccomp/runtime/pats_ccomp_instrset.h:266:35: error: assignment makes pointer from integer without a cast [-Werror] #define ATSINSmove(tmp, val) (tmp = val) ^ build/user/user_main_dats.c:873:1: note: in expansion of macro 'ATSINSmove' ATSINSmove(tmp19__1, atspre_malloc_gc(tmp20__1)) ; ^ cc1: all warnings being treated as errors ../Makefile.common:146: recipe for target 'build/user/user_main_dats.o' failed make: *** [build/user/user_main_dats.o] Error 1 rm build/user/user_main_dats.c ``` What's wrong? On POSIX, following code is available: ``` #include "share/atspre_define.hats" #include "share/atspre_staload.hats" %{^ void atsruntime_mfree_undef (void *ptr) { free(ptr); return; } void *atsruntime_malloc_undef (size_t bsz) { return malloc(bsz); } %} implement main0 () = { val json_data = string0_append ("{\"temperature\": ", "") val () = println! json_data val () = free json_data } ``` Thanks, -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-11-14 13:08:48
|
On Sat, Nov 14, 2015 at 9:46 PM, gmhwxi <gm...@gm...> wrote: > There seems a misuse of quantifier: > > typedef dns_found_callback_t = {l:addr} (!ip_addr_t@l | string, ptr l, ptr) > -> void Fixed. Thanks. BTW. How to understand following error message? ``` ATS user/user_main.dats /home/kiwamu/src/esp8266-ats/dweet_ats/user/user_main.dats: 1022(line=32, offs=24) -- 1026(line=32, offs=28): error(3): the dynamic expression cannot be assigned the type [S2Eat(S2Etyrec(fltext(ip_addr_t); npf=-1; addr=S2Ecst(uint32)), S2Evar(l$3144(7279)))]. /home/kiwamu/src/esp8266-ats/dweet_ats/user/user_main.dats: 1022(line=32, offs=24) -- 1026(line=32, offs=28): error(3): mismatch of sorts in unification: The sort of variable is: S2RTbas(S2RTBASimp(1; t@ype)) The sort of solution is: S2RTbas(S2RTBASimp(7; view)) ``` -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-11-14 13:02:39
|
On Sat, Nov 14, 2015 at 9:49 PM, gmhwxi <gm...@gm...> wrote: > By the way, what is the type of dns_done_c? extern fun dns_done_c: dns_found_callback_t = "mac#" -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-11-14 12:06:44
|
Hi all, I'm trying to make a function exported from C language. ATS language side is following: ``` typedef dns_found_callback_t = [l:addr] (ip_addr_t@l | string, ptr l, ptr) -> void extern fun dns_done: dns_found_callback_t = "mac#" implement dns_done (pfat | name, ipaddr, arg) = { val () = dns_done_c (pfat | name, ipaddr, arg) // <= Error occurs at here! } ``` C language side is following: ``` void dns_done_c( const char *name, ip_addr_t *ipaddr, void *arg ) { ... ``` I believe the view will be removed after compile. However the code can't be compiled. ``` $ make ATS user/user_main.dats /home/kiwamu/src/esp8266-ats/dweet_ats/user/user_main.dats: 1022(line=32, offs=24) -- 1026(line=32, offs=28): error(3): the dynamic expression cannot be assigned the type [S2Eat(S2Etyrec(fltext(ip_addr_t); npf=-1; addr=S2Ecst(uint32)), S2Evar(l$3144(7279)))]. /home/kiwamu/src/esp8266-ats/dweet_ats/user/user_main.dats: 1022(line=32, offs=24) -- 1026(line=32, offs=28): error(3): mismatch of sorts in unification: The sort of variable is: S2RTbas(S2RTBASimp(1; t@ype)) The sort of solution is: S2RTbas(S2RTBASimp(7; view)) /home/kiwamu/src/esp8266-ats/dweet_ats/user/user_main.dats: 1022(line=32, offs=24) -- 1026(line=32, offs=28): error(3): mismatch of static terms (tyleq): The actual term is: S2EVar(1955) The needed term is: S2Eat(S2Etyrec(fltext(ip_addr_t); npf=-1; addr=S2Ecst(uint32)); S2Evar(l$3144(7279))) ``` How to use extype on at-view? Thanks, -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-11-08 10:53:14
|
Hi Hongwei, On Sun, Nov 8, 2015 at 12:36 AM, gmhwxi <gm...@gm...> wrote: > I have a suggestion that you also make webpage-based slides. > Then you can present your code "lively": > > http://ats-lang.github.io/EXPERIMENT/patsopt-atscc2js-trial/index.html > > This will allow people to easily try your code when reading your slides. > They will be much more impressed in this way because they are able to > experience first-handedly how program mistakes are caught as type-errors > by the typechecker of ATS. Thanks for your advice. I have many chance to explain ATS language for beginners. The webpage is useful for it. Thanks, -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-11-06 11:48:39
|
Hi all, I made a slide to explain statics and proofs on ATS language. http://www.slideshare.net/master_q/static-typing-and-proof-on-ats-language Could you check the following figures? > Hongwei I may miss-understand it. http://www.slideshare.net/master_q/static-typing-and-proof-on-ats-language/9 http://www.slideshare.net/master_q/static-typing-and-proof-on-ats-language/13 http://www.slideshare.net/master_q/static-typing-and-proof-on-ats-language/16 Thanks, -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-11-01 14:51:31
|
On Tue, Oct 27, 2015 at 3:31 PM, Hongwei Xi <gm...@gm...> wrote: >>>And, where is body of the static function? > > There is none. > > A stacst is not implemented in ATS. Instead, the meaning of a stacst is > determined by the constraint-solver. Why we can't implement static function using `sif` and `scase`? -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-10-30 14:51:12
|
Hi Mike, I'm also newbie. On Oct 30, 2015 22:38, "Mike Jones" <pro...@gm...> wrote: > What is stacst? (Static Cast?) is there some explanation of how it works? The `stacst` introduce only signature of the static function. It doesn't introduce body. If you use the static function, you also need to introduce some hint for the constraint-solver. https://github.com/jats-ug/practice-ats/blob/b408db3ffccad49a3f380987a2ecae88f62b2dbe/static_rps/rps.dats#L31 Please remove following lines and try to compile. You will see some error on the constraint-solver. ``` prval () = rps_win_s_p_pf() ``` > Why is extern required for extern praxi in dats? I think it has no body in the proof functions. > I thought of proofs and statics as being tossed after compile, but it looks like you can execute them. I assume this practice is mainly for testing? Sometime the code has both dynamics and proofs. For example, the function `rps_win_s` has dynamics code and static interface. https://github.com/jats-ug/practice-ats/blob/b408db3ffccad49a3f380987a2ecae88f62b2dbe/static_rps/rps.sats#L22 Also, the `rps_win_p` function has dynamics code and proof code. https://github.com/jats-ug/practice-ats/blob/b408db3ffccad49a3f380987a2ecae88f62b2dbe/static_rps/rps.sats#L40 Dynamics code should be alive after compile, while statics and proofs are deleted at the time. I think following slide is useful to understand it. http://www.slideshare.net/master_q/atslf-for-coq-users/6 Thank's, |
From: Kiwamu O. <ki...@gm...> - 2015-10-30 13:26:09
|
On Oct 30, 2015 22:01, "Kiwamu Okabe" <ki...@de...> wrote: > Which style is more better? Of course, the statics style is nonsense, Sorry. I meaned "dynamics style is nonsense." |
From: Kiwamu O. <ki...@de...> - 2015-10-30 13:01:39
|
Hi all, Finally, I defined the function in dynamics and statics, proofs. https://github.com/jats-ug/practice-ats/tree/master/static_rps Which style is more better? Of course, the statics style is nonsense, because it should use exception. But my head think proofs style is better. How do you think? > all Thanks, -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-10-30 11:01:01
|
Hi Hongwei, On Wed, Oct 28, 2015 at 12:24 PM, Hongwei Xi <gm...@gm...> wrote: > Say you want to use rps_win(r, s) in your reasoning. You just do: > > prval () = rps_win_r_s() // adding rps_win(r, s) into the current pool of > assumptions > > The constraint-solver simply treats rps_win like an unknown function symbol. Also, I can define rps_even as following: https://gist.github.com/master-q/a590dcf8f692e065c2e1#file-rps-dats-L89 > By the way, Z3 does a much better job in handling unknown function symbols. I'm waiting the paper about Z3 on FLOPS. Thank's, -- Kiwamu Okabe at METASEPI DESIGN |
From: Raoul D. <ra...@gm...> - 2015-10-28 20:21:18
|
Congratulations! Keep it rolling. |
From: Hongwei Xi <hw...@bu...> - 2015-10-28 16:41:32
|
Hi, I am glad to announce the release of ATS2-0.2.4. This is the 27th release of ATS2, the successor of the ATS (currently referred to as ATS1) programming language. The compiler for ATS2 is given the name ATS/Positats, ATS2/Postiats or simply Postiats. ###### The official website for ATS is: http://www.ats-lang.org ATS-Postiats is hosted at github: https://github.com/githwxi/ATS-Postiats Major releases of ATS2 are available at: https://sourceforge.net/projects/ats2-lang/ Major releases of external packages for ATS2 are available at: https://sourceforge.net/projects/ats2-lang-contrib/ A google-group for discussing ATS and related issues is at: https://groups.google.com/forum/?fromgroups#!forum/ats-lang-users ###### The following packages are included in this release: ATS2-Postiats-0.2.4.tgz # requiring libgmp ATS2-Postiats-contrib-0.2.4.tgz # contributed packages ATS2-Postiats-include-0.2.4.tgz # CATS-files w/ BSD-like license I have included ATS2-Postiats-contrib (instead of releasing it separately) as it is truly by now an indispensible part of ATS2. After installing ATS-Postiats-include, one can compile the C code generated from ATS source without installing the ATS compiler. So a convenient way to distribute software written in ATS is to simply release the C code generated from the ATS source. See below for some major additions and changes since the last release (ATS2-0.2.3). ###### Cheers, --Hongwei Xi Computer Science Department Boston University 111 Cummington Street Boston, MA 02215 Email: hw...@cs... Url: http://www.cs.bu.edu/~hwxi Tel: +1 617 358 2511 (office) Fax: +1 617 353 6457 (department) ###### Here is a list of major additions and changes since the last release: ###### 1. Fixing a bug due to abstract types being given the 'empty' name. 2. Adding libats/theGetters 3. Fixing a bug in ATS-extsolve (involving the s2rtdatmap generation) 4. Fixing a minor parsing bug in CATS-parsemit 5. Adding libatsopt, the library version of patsopt; see utils/libatsopt 6. Adding some ifdef-guards: ATS_EXTERN_DEF__ for guarding the definition of ATSextern() ATS_STATIC_DEF__ for guarding the definition of ATSstatic() ATS_INLINE_DEF__ for guarding the definition of ATSinline() 7. Adding some examples to illustrate a way of using ATS+Emscripten 8. Supporting evaluated expressions (of the form %(...)) in statics 9. Generally improving libatscc2js and libatscc2erl 10. With libatsopt(JS), patsopt can now run entirely inside the browser. 11. Adding char2int1 and fixing add_bool_bool and mul_bool_bool |
From: Kiwamu O. <ki...@de...> - 2015-10-25 09:15:35
|
Hi all, https://github.com/jats-ug/practice-ats/tree/master/static_rps It's used as following: ``` implement main0 () = { val paper = p_rps_t() val (pf_win | win) = rps_win (paper) val () = println! (win, " win ", paper, ".") // => Scissors win Paper. val (_, _ | even) = rps_even (pf_win | win, paper) val () = println! (even, " even between ", win, " and ", paper, ".") // => Rock even between Scissors and Paper. } ``` The `rps_win` function returns a value that wins the argument. The `rps_even` function returns a value that evens between the arguments. ATS language prove these functions. I have a question. Can I implement `rps_win` and `rps_even` functions using static function? I would like to implement them as following: fun{} rps_win {r1:rps_s} (x: rps_t (r1)): [r2:rps_s | s_win(r2, r1)] (rps_t (r2)) Can I implement statics function such like `s_win`? Thank's, -- Kiwamu Okabe at METASEPI DESIGN |
From: john s. <sk...@us...> - 2015-10-24 19:15:19
|
> On 25 Oct 2015, at 00:50, gmhwxi <gm...@gm...> wrote: > > Correct. > > You can use ‘_ when ...' instead: For that I use another shorthand: | (A, $constant) => … translates to | (A, synthvar) when synthvar == constant => … — john skaller sk...@us... http://felix-lang.org |
From: john s. <sk...@us...> - 2015-10-24 19:10:30
|
> On 25 Oct 2015, at 00:07, gmhwxi <gm...@gm...> wrote: > > > 'true' and 'false' are constants. They are treated specially when > used as patterns. That’s naughty! Here’s what I did: 1) Felix originally copied Ocaml in having constant (no argument) constructors. However I hate Camelcase. So I made the user do this: | Fred ?argument => … | Joe => … 2) This is ugly, having to put ? before variables. So I changed it. I copied ATS :-) No constant constructors: | Fred argument => … | Joe () => … 3) Felix always had an abbreviation in expressions: #f ==> f () Its a shorthand which is very useful because in Felix type classes you cannot have constants, only functions. So you have to do #zero[double] for example, for the real number class zero, instance double. 4) Hence: match .. with | #True => … | #False => … 5) In fact the parser translates true and false, they’re treated “special” in the parser NOT in pattern matches. Having special things in core parts of the compiler add complexity. — john skaller sk...@us... http://felix-lang.org |
From: Kiwamu O. <ki...@de...> - 2015-10-24 13:53:04
|
Hi Hongwei, On Sat, Oct 24, 2015 at 10:50 PM, gmhwxi <gm...@gm...> wrote: > You can use '_ when ...' instead: > > https://github.com/githwxi/ATS-Postiats-test/blob/master/contrib/hwxi/TEST20/test21.dats Clear. I think I understand it. Thank's, -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-10-24 13:40:40
|
Hi Hongwei, On Sat, Oct 24, 2015 at 10:36 PM, gmhwxi <gm...@gm...> wrote: > You can. You just cannot use them (r_rps, p_rps, s_rps) > as patterns. Note that 'true' and 'false' are treated specially when > used as patterns. Hmm... I can define constructors of rps. I can use the constructors as patterns. I can define constants of rps. I can't use the constants as patterns. Correct? Thank's, -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-10-24 13:32:40
|
Hi Hongwei, On Sat, Oct 24, 2015 at 10:22 PM, Kiwamu Okabe <ki...@de...> wrote: > 'true' and 'false' are pre-defined constants? > I can't find the definition in prelude? Following is the definition of true? https://github.com/githwxi/ATS-Postiats/blob/master/prelude/basics_dyn.sats#L59 Why my following code can't define the constants of rps? https://github.com/jats-ug/practice-ats/blob/ce6d2001867fa4a9db6c3dc9fb2044d5346bfc6f/static_rps/rps.sats#L10 Thank's, -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-10-24 13:23:09
|
Hi Hongwei, On Sat, Oct 24, 2015 at 10:07 PM, gmhwxi <gm...@gm...> wrote: > 'true' and 'false' are constants. They are treated specially when > used as patterns. > > On Saturday, October 24, 2015 at 8:58:22 AM UTC-4, Kiwamu Okabe wrote: >> Where is the constructor of true and false? 'true' and 'false' are pre-defined constants? I can't find the definition in prelude? Thank's, -- Kiwamu Okabe at METASEPI DESIGN |
From: Kiwamu O. <ki...@de...> - 2015-10-24 12:58:28
|
Hi Hongwei, On Sat, Oct 24, 2015 at 9:34 PM, gmhwxi <gm...@gm...> wrote: > r_rps is not a constructor and thus cannot be used as a pattern > (the compiler treats it as a variable that matches any value) > > Try: > > datatype rps(rps) = r_rps(r_rps) | p_rps(p_rps) | s_rps(s_rps) > > Then you can use r_rps() as a pattern. Fixed my code. https://github.com/jats-ug/practice-ats/commit/c2b7d57abbde3a0a7f68173179bd2db2f069521c Where is the constructor of true and false? Thank's, -- Kiwamu Okabe at METASEPI DESIGN |