<div dir="ltr"><div><div><div><div>Ok, report back 24 hrs after a Haskell Cafe email [1] and reference to it on Reddit [2].<br><br></div>The Reddit post has 16 upvotes and no downvotes.<br><br></div>The Haskell Cafe post generated two reponses, one from Andrew Gibiansky (IHaskell,ghc-parser), and one from Mateusz Kowalczyk (Haddock,yi,GHC), both in favour.<br><br></div>Neil Mitchell (hlint) has also expressed support on this mailing list.<br><br></div>And of course the most enthusiastic user is me, as it will simplify HaRe dramatically.<br><br><div><div><br>[1] <a href="http://www.haskell.org/pipermail/haskell-cafe/2014-October/116267.html">http://www.haskell.org/pipermail/haskell-cafe/2014-October/116267.html</a><br>[2] <a href="http://www.reddit.com/r/haskell/comments/2i0jo8/haskellcafe_ghc_710_ghcapi_changes_and_proposed/">http://www.reddit.com/r/haskell/comments/2i0jo8/haskellcafe_ghc_710_ghcapi_changes_and_proposed/</a><br><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 1, 2014 at 7:44 PM, Simon Peyton Jones <span dir="ltr"><<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Let me urge you, once again, to consult users.  I really do not want to implement a feature that (thus far) lacks a single enthusiastic
 user.  Please.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Simon<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"> Alan & Kim Zimmerman [mailto:<a href="mailto:alan.zimm@gmail.com" target="_blank">alan.zimm@gmail.com</a>]
<br>
<b>Sent:</b> 01 October 2014 16:13<br>
<b>To:</b> Simon Peyton Jones<br>
<b>Cc:</b> Richard Eisenberg; Edward Z. Yang; <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a></span></p><div><div class="h5"><br>
<b>Subject:</b> Re: Feedback request for #9628 AST Annotations<u></u><u></u></div></div><p></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
I have put up a new diff at <a href="https://phabricator.haskell.org/D297" target="_blank">https://phabricator.haskell.org/D297</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
It is just a proof of concept at this point, to check if the approach is acceptable.<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
This is much less intrusive, and only affects the lexer/parser, in what should be a transparent way.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
The new module ApiAnnotation was introduced because it needs to be imported by Lexer.x, and I was worried about another circular import cycle. It does also allow the annotations to be defined in a self-contained way,  which can then easily be used by other
 external projects such as ghc-parser.<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
If there is consensus that this will not break anything else, I would like to go ahead and add the rest of the annotations.<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Regards<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
  Alan<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
On Tue, Sep 30, 2014 at 11:19 AM, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
I'm anxious about it being too big a change too.<br>
<br>
I'd be up for it if we had several "customers" all saying "yes, this is precisely what we need to make our usage of the GHC API far far easier".  With enough detail so we can understand their use-case.<br>
<br>
Otherwise I worry that we might go to a lot of effort to solve the wrong problem; or to build a solution that does not, in the end, work for the actual use-case.<br>
<br>
Another way to tackle this would be to ensure that syntax tree nodes have a "node-key" (a bit like their source location) that clients could use in a finite map, to map node-key to values of their choice.<br>
<br>
I have not reviewed your patch in detail, but it's uncomfortable that the 'l' parameter gets into IfGblEnv and DsM.  That doesn't smell right.<br>
<br>
Ditto DynFlags/HscEnv, though I think here that you are right that the "hooks" interface is very crucial.  After all, the WHOLE POINT is too make the client interface more flexible. I would consult Luite and Edsko, who were instrumental in designing the new
 hooks interface<br>
        <a href="https://ghc.haskell.org/trac/ghc/wiki/Ghc/Hooks" target="_blank">
https://ghc.haskell.org/trac/ghc/wiki/Ghc/Hooks</a><br>
(I'm not sure if that page is up to date, but I hope so)<br>
<br>
A good way to proceed might be to identify some of the big users of the GHC API (I'm sure I don't know them all), discuss with them what would help them, and share the results on a wiki page.<br>
<span style="color:#888888"><br>
<span>Simon</span></span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<br>
|  -----Original Message-----<br>
|  From: ghc-devs [mailto:<a href="mailto:ghc-devs-bounces@haskell.org" target="_blank">ghc-devs-bounces@haskell.org</a>] On Behalf Of<br>
|  Richard Eisenberg<br>
|  Sent: 30 September 2014 03:04<br>
|  To: Edward Z. Yang<br>
|  Cc: <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
|  Subject: Re: Feedback request for #9628 AST Annotations<br>
|<br>
|  I'm only speaking up because Alan is specifically requesting feedback:<br>
|  I'm really ambivalent about this. I agree with Edward that this is a<br>
|  big change and adds permanent noise in a lot of places. But, I also<br>
|  really respect the goal here -- better tool support. Is it worthwhile<br>
|  to do this using a dynamically typed bit (using Typeable and such),<br>
|  which would avoid the noise? Maybe.<br>
|<br>
|  What do other languages do? Do we know what, say, Agda does to get<br>
|  such tight coupling with an editor? Does, say, Eclipse have such a<br>
|  chummy relationship with a Java compiler to do its refactoring, or is<br>
|  that separately implemented? Haskell/GHC is not the first project to<br>
|  have this problem, and there's plenty of solutions out there. And,<br>
|  unlike most other times, I don't think Haskell is exceptional in this<br>
|  regard (there's nothing very special about Haskell's AST, maybe beyond<br>
|  indentation-awareness), so we can probably adopt other solutions<br>
|  nicely.<br>
|<br>
|  Richard<br>
|<br>
|  On Sep 29, 2014, at 8:58 PM, "Edward Z. Yang" <<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>> wrote:<br>
|<br>
|  > Excerpts from Alan & Kim Zimmerman's message of 2014-09-29 13:38:45<br>
|  -0700:<br>
|  >> 1. Is this change too big, should I scale it back to just update<br>
|  the<br>
|  >>   HsSyn structures and then lock it down to Located SrcSpan for all<br>
|  >>   the rest?<br>
|  ><br>
|  > I don't claim to speak for the rest of the GHC developers, but I<br>
|  think<br>
|  > this change is too big.  I am almost tempted to say that we<br>
|  shouldn't<br>
|  > add the type parameter at all, and do something else (maybe Backpack<br>
|  > can let us extend SrcSpan in a modular way, or even use a<br>
|  dynamically<br>
|  > typed map for annotations.)<br>
|  ><br>
|  > Edward<br>
|  > _______________________________________________<br>
|  > ghc-devs mailing list<br>
|  > <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
|  > <a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
|<br>
|  _______________________________________________<br>
|  ghc-devs mailing list<br>
|  <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
|  <a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br></div>