Re: [GHC] #9628: Add Annotations to the AST to simplify source to source conversions

For the review process I updated the phabricator summary to capture the
current implementation, I will move it on to the wiki too.
The ExtraCommas have been removed as unworkable, they are an abandoned
point in the design space. The lessons learned are being transferred to
Alexander Berntsen for his record syntax extension proposal.
I did consider bringing comments in directly, as being a natural part of
things, but did not want to confuse the issue too much in one go. It
should be possible to capture them in a similar process, and it will
definitely help with round tripping. At the moment tooling has to access
them via `getRichTokenStream` and then work them in to the correct place.
In terms of haddock usage, I would have to discuss with them what they
do/need, to find out if this will serve as a replacement.
On Mon, Oct 20, 2014 at 9:55 AM, GHC
#9628: Add Annotations to the AST to simplify source to source conversions -------------------------------------+------------------------------------- Reporter: alanz | Owner: alanz Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.9 Component: Compiler | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: D297 | -------------------------------------+-------------------------------------
Comment (by simonpj):
Well done for making progress. Some thoughts
* If the patch is ready for review, is [wiki:GhcAstAnnotations] also fully up to date? Could you move any discussion of alternatives to the end, under "Other possible design alternatives" so that what remains is actually a description of the feature you propose, and a sketch of its implementation? I'm unsure about which bits of the wiki page are rejected ideas and which are the ones you adopted.
* Floating around is also `ExtraCommas`. I think the two are somewhat orthogonal, right?
* Does your design say where comments are? That is, can you really round-trip source code?
In particular, an excellent criterion could be: can you do Haddock this way? Currently Haddock has a lot of Haddock-specific fields in HsSyn. Could they all be replaced with annotations in your style? If not, what would take to make that possible? It would be highly cool; after all, Haddock may be privileged, but the more we can make it possible for others to do Haddock-like things without changing GHC itself, the better.
* You outlined a number of "customers" in an earlier post. Would it be worth adding them to the wiki page?
Simon
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9628#comment:30 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
Alan & Kim Zimmerman