<div dir="ltr">Hi David, <div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Which is better to start with: HsSyn or Core? Intuition suggests this sort of thing could be very helpful for making zapping more reliable and ensuring its efficiency, but there may be better reasons to start with HsSyn.</blockquote><div><br></div><div>- Why not making Core growable as well?</div><div>We just have not considered making Core AST growable so far, though it is entirely doable if needed. </div><div>Specially, if you have some motivating examples that a growable Core AST "could be very helpful" like for "making zapping more reliable and ensuring its efficiency", let us know; we can consider making Core growable as well (possibly as an independent project). </div><div><br></div><div>- Why not making Core growable first?</div><div>Here the idea is to make HsSyn AST growable for the long-term goals stated on the wiki page, like getting rid of the multiple representations of Haskell syntax (i.e., HsSyn, Template Haskell, and Haskell-Src-Exts).</div><div>I imagine making Core AST growable does not get us closer to our current long-term goals (except maybe as an experiment to study the impact of such AST changes on GHC, like we did in D3609)</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">2. If we're making intrusive changes to representations, would now be a sensible era to consider switching to a different variable representation (unbound, bound, abt, etc)?</blockquote><div> </div><div>- While we are at it, can we consider improving some bits of the AST?</div><div>For the first few steps, I really hope to keep the changes to representations as little as possible, at least to ease the reviewing process and to avoid introducing bugs (provided the large scale of the changes).</div><div>For the next steps, we can indeed consider such improvements. (We do so for source locations, at least)</div><div><br></div><div>Do you have some specific changes in mind? Specially the ones that may overlap with our work? </div><div><br></div><div>Thanks.</div><div><br></div><div>/Shayan</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 26, 2017 at 2:11 AM, David Feuer <span dir="ltr"><<a href="mailto:david@well-typed.com" target="_blank">david@well-typed.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>I haven't looked in detail yet, but there seem to be good ideas. I have two questions:</div><div><br></div><div>1. Which is better to start with: HsSyn or Core? Intuition suggests this sort of thing could be very helpful for making zapping more reliable and ensuring its efficiency, but there may be better reasons to start with HsSyn.</div><div><br></div><div>2. If we're making intrusive changes to representations, would now be a sensible era to consider switching to a different variable representation (unbound, bound, abt, etc)?</div><div><br></div><div><br></div><div id="m_420396535712377128composer_signature"><div style="font-size:85%;color:#575757">David Feuer</div><div style="font-size:85%;color:#575757">Well-Typed, LLP</div></div><div><div class="h5"><div><br></div><div style="font-size:100%;color:#000000"><div>-------- Original message --------</div><div>From: Simon Peyton Jones via ghc-devs <<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a>> </div><div>Date: 5/25/17  6:48 PM  (GMT-05:00) </div><div>To: Alan & Kim Zimmerman <<a href="mailto:alan.zimm@gmail.com" target="_blank">alan.zimm@gmail.com</a>>, <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a> </div><div>Subject: RE: Trees that Grow in the hsSyn AST </div><div><br></div></div>Folks<br><br>Do take a look at this:<br><br><br>·        We propose to re-engineer HsSyn itself.  This will touch a lot of code.<br><br>·        But it’s very neat, and will bring big long-term advantages<br><br>·        And we can do it a bit at a time<br><br>The wiki page <a href="https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow" target="_blank">https://ghc.haskell.org/trac/<wbr>ghc/wiki/<wbr>ImplementingTreesThatGrow</a> has the details.<br><br>It’s entirely an internal change, not a change to GHC’s specification, so it’s independent of the GHC proposals process.  But I’d value the opinion of other GHC devs.<br><br>Alan has done a prototype first step, which worked out rather well.  Rather than having<br>               HsExpr Id<br>(which we all know means “HsExpr after the typechecker” but tha’s a bit inexplicit, we have<br>               HsExpr GhcTc<br>meaning “HsExpr after GHC’s Tc pass”.   In some ways this is quite superficial, but it unlocks the Trees That Grow machiney.<br><br>Please ask questions etc.  Alan and Shayan can record the answers in the wiki.  I’m inclined to go ahead with this, so yell soon if you disagree.<br><br>Simon<br><br>From: ghc-devs [mailto:<a href="mailto:ghc-devs-bounces@haskell.org" target="_blank">ghc-devs-bounces@<wbr>haskell.org</a>] On Behalf Of Alan & Kim Zimmerman<br>Sent: 24 May 2017 22:52<br>To: <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>Subject: Trees that Grow in the hsSyn AST<br><br>Hi all<br><br>You may be aware that Shayan Najd presented the paper  "Trees that Grow"[1] at HIW last year.<br>Based on the following mandate<br>> As in my previous email to Shayan (attached).  Wiki page, describe goals, design,<br>> approach.  Point to prototype implementation.  Seek comments.   You can say that<br>>I am supportive!<br>><br>> Simon<br><br>We have set up a Wiki page at [2] describing a prototype implementation of the first stage of this for the hsSyn AST, which is to change the polymorphic variable from one of RdrName / Name / Id to an index type. This is presented as a fabricator diff at [3].<br>Please take a look and provide feedback.<br>Regards<br>  Alan<br><br><br></div></div>[1] <a href="http://www.jucs.org/jucs_23_1/trees_that_grow/jucs_23_01_0042_0062_najd.pdf" target="_blank">http://www.jucs.org/jucs_23_1/<wbr>trees_that_grow/jucs_23_01_<wbr>0042_0062_najd.pdf</a><<a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jucs.org%2Fjucs_23_1%2Ftrees_that_grow%2Fjucs_23_01_0042_0062_najd.pdf&data=02%7C01%7Csimonpj%40microsoft.com%7C5faccc0d2d534c42c23e08d4a2ef36d8%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C1%7C636312595690311243&sdata=fbLJdJqSyXgacCEJwVH880aLsHDgDY46hrc%2FtDXv4VQ%3D&reserved=0" target="_blank">https://<wbr>na01.safelinks.protection.<wbr>outlook.com/?url=http%3A%2F%<wbr>2Fwww.jucs.org%2Fjucs_23_1%<wbr>2Ftrees_that_grow%2Fjucs_23_<wbr>01_0042_0062_najd.pdf&data=02%<wbr>7C01%7Csimonpj%40microsoft.<wbr>com%<wbr>7C5faccc0d2d534c42c23e08d4a2ef<wbr>36d8%<wbr>7C72f988bf86f141af91ab2d7cd011<wbr>db47%7C1%7C1%<wbr>7C636312595690311243&sdata=<wbr>fbLJdJqSyXgacCEJwVH880aLsHDgDY<wbr>46hrc%2FtDXv4VQ%3D&reserved=0</a>><span class=""><br>[2] <a href="https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow" target="_blank">https://ghc.haskell.org/trac/<wbr>ghc/wiki/<wbr>ImplementingTreesThatGrow</a><br>[3] <a href="https://phabricator.haskell.org/D3609" target="_blank">https://phabricator.haskell.<wbr>org/D3609</a><br></span></div><br>______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div><br></div>