Re: [dylan] Mindy: Surface syntax
Stefan Edwards <[email protected]> Sun, 1 Nov 2015 20:34:02 -0500
| Newsgroups | gmane.comp.lang.dylan.gwydion.devel |
|---|---|
| Message-ID | <CAEMRNFP5aRneBAo6wndZ=uiykYW=ptOesDh=LTAszy4XSGhOYQ@mail.gmail.com> |
--===============0058989853== Content-Type: multipart/alternative; boundary=047d7b3a96c2abcef0052384c5ee --047d7b3a96c2abcef0052384c5ee Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Chicken Scheme has the (: ...) syntax as well, whereas Bigloo moves it more into the definition with :: syntax. Personally, I like the Bigloo-style better. As it means tools can process things in *one* place, but I'm fine with either really, just tossing my =C2=A30.02 in. On Nov 1, 2015 8:09 PM, "Bruce Mitchener" <[email protected]> wrote= : > As usual whenever Dylan gets much attention, the subject of the syntax > comes up. > > As such, we're interested in entertaining a discussion about adding a new > surface syntax to Mindy. This could be a pilot project for perhaps applyi= ng > it to Open Dylan in the future. > > Long ago, I had started some notes about various similar syntax options: > > > https://github.com/waywardmonkeys/prefixy-dylan-notes/blob/master/source/= index.rst > > It might be interesting to think a bit broader than this though and look > at some other options: > > > - Something ML inspired? What might this look like? > - Something inspired by Pyret (http://www.pyret.org/)? > - ??? > > One common complaint about prefix-dylan syntax (shared by Scott McKay a > few hours ago on Twitter as well) is that it uses a lot of parentheses. > > One way to address that is to do what Goo did: > > (dm floor/ (real|<num> divisor|<num> =3D> (tup x|<int> rem|<num>)) > ...) > > > or like Mikel Evins did in Bard: > > (define (signature-more-specific? s1::TypeSignature s2::TypeSignature) > (if (eqv? s1 s2) > #t > (every subtype? s1:types s2:types))) > > > Another way would be to take the approach of Typed Racket and move the > type annotations out of the signature: > > (: flexible-length (-> (U String (Listof Any)) Integer)) > (define (flexible-length str-or-lst) > (if (string? str-or-lst) > (string-length str-or-lst) > (length str-or-lst))) > > > As for an ML-like syntax, a very long time ago, there was an article on > the semantics of Dylan that used an ML-like syntax: > > IsClass :: ClassName -> ClassList -> Boolean > IsClass (cl:ClassName) ([]:ClassList) =3D False > IsClass cl (c::cs) =3D > if cl =3D c.name then True else IsClass cl ... > > > That article can be found here: > https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai/lang/others/dylan/= doc/semantic/0.html > > There's probably room to look at some of what Cecil did as well as > Fortress. > > Discussion and thoughts welcome! > > - Bruce > > > _______________________________________________ > hackers mailing list > [email protected] > https://lists.opendylan.org/mailman/listinfo/hackers > > --047d7b3a96c2abcef0052384c5ee Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <p dir=3D"ltr">Chicken Scheme has the (: ...) syntax as well, whereas Biglo= o moves it more into the definition with :: syntax. Personally, I like the = Bigloo-style better. As it means tools can process things in *one* place, b= ut I'm fine with either really, just tossing my =C2=A30.02 in.</p> <div class=3D"gmail_quote">On Nov 1, 2015 8:09 PM, "Bruce Mitchener&qu= ot; <<a href=3D"mailto:[email protected]">bruce.mitchener@gmail.= com</a>> wrote:<br type=3D"attribution"><blockquote class=3D"gmail_quote= " style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><= div dir=3D"ltr">As usual whenever Dylan gets much attention, the subject of= the syntax comes up.<div><br></div><div>As such, we're interested in e= ntertaining a discussion about adding a new surface syntax to Mindy. This c= ould be a pilot project for perhaps applying it to Open Dylan in the future= .</div><div><br></div><div>Long ago, I had started some notes about various= similar syntax options:</div><div><br></div><div>=C2=A0 =C2=A0=C2=A0<a hre= f=3D"https://github.com/waywardmonkeys/prefixy-dylan-notes/blob/master/sour= ce/index.rst" target=3D"_blank">https://github.com/waywardmonkeys/prefixy-d= ylan-notes/blob/master/source/index.rst</a></div><div><br></div><div>It mig= ht be interesting to think a bit broader than this though and look at some = other options:</div><div><br></div><div><ul><li>Something ML inspired? What= might this look like?<br></li><li>Something inspired by Pyret (<a href=3D"= http://www.pyret.org/" target=3D"_blank">http://www.pyret.org/</a>)?</li><l= i>???</li></ul><div>One common complaint about prefix-dylan syntax (shared = by Scott McKay a few hours ago on Twitter as well) is that it uses a lot of= parentheses.</div></div><div><br></div><div>One way to address that is to = do what Goo did:</div><div><br></div><blockquote style=3D"margin:0px 0px 0p= x 40px;border:none;padding:0px"><div><div>(dm floor/ (real|<num> divi= sor|<num> =3D> (tup x|<int> rem|<num>))</div></div><di= v><div>=C2=A0 ...)</div></div></blockquote><div><br></div><div>or like Mike= l Evins did in Bard:</div><div><br></div><blockquote style=3D"margin:0px 0p= x 0px 40px;border:none;padding:0px"><div><div>(define (signature-more-speci= fic? s1::TypeSignature s2::TypeSignature)</div></div><div><div>=C2=A0 (if (= eqv? s1 s2)</div></div><div><div>=C2=A0 =C2=A0 =C2=A0 #t</div></div><div><d= iv>=C2=A0 =C2=A0 =C2=A0 (every subtype? s1:types s2:types)))</div></div></b= lockquote><div><br></div><div>Another way would be to take the approach of = Typed Racket and move the type annotations out of the signature:</div><div>= <br></div><blockquote style=3D"margin:0px 0px 0px 40px;border:none;padding:= 0px"><div><div>(: flexible-length (-> (U String (Listof Any)) Integer))<= /div></div><div><div>(define (flexible-length str-or-lst)</div></div><div><= div>=C2=A0 (if (string? str-or-lst)</div></div><div><div>=C2=A0 =C2=A0 =C2= =A0 (string-length str-or-lst)</div></div><div><div>=C2=A0 =C2=A0 =C2=A0 (l= ength str-or-lst)))</div></div></blockquote><div><br></div><div>As for an M= L-like syntax, a very long time ago, there was an article on the semantics = of Dylan that used an ML-like syntax:</div><div><br></div><blockquote style= =3D"margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>IsClass :: C= lassName -> ClassList -> Boolean</div></div><div><div>IsClass (cl:Cla= ssName) ([]:ClassList) =3D False</div></div><div><div>IsClass cl (c::cs) = =3D</div></div><div><div>=C2=A0 =C2=A0if cl =3D <a href=3D"http://c.name" t= arget=3D"_blank">c.name</a> then True else IsClass cl ... =C2=A0 =C2=A0=C2= =A0</div></div></blockquote><div><br></div><div>That article can be found h= ere:=C2=A0<a href=3D"https://www.cs.cmu.edu/afs/cs/project/ai-repository/ai= /lang/others/dylan/doc/semantic/0.html" target=3D"_blank">https://www.cs.cm= u.edu/afs/cs/project/ai-repository/ai/lang/others/dylan/doc/semantic/0.html= </a></div><div><br></div><div>There's probably room to look at some of = what Cecil did as well as Fortress.</div><div><br></div><div>Discussion and= thoughts welcome!</div><div><br></div><div>=C2=A0- Bruce</div><div><br></d= iv></div> <br>_______________________________________________<br> hackers mailing list<br> <a href=3D"mailto:[email protected]">[email protected]<= /a><br> <a href=3D"https://lists.opendylan.org/mailman/listinfo/hackers" rel=3D"nor= eferrer" target=3D"_blank">https://lists.opendylan.org/mailman/listinfo/hac= kers</a><br> <br></blockquote></div> --047d7b3a96c2abcef0052384c5ee-- --===============0058989853== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ hackers mailing list [email protected] https://lists.opendylan.org/mailman/listinfo/hackers --===============0058989853==--