Patch/feature proposal: "Source plugins"

Edsko de Vries edskodevries at gmail.com
Mon Jul 8 19:01:32 CEST 2013


Ok, sorry all for the delay. Attached is a "frontend plugins" patch for ghc
7.4.2. It will not work for ghc HEAD because the structure of the compiler
has changed in various places, but I cannot currently compile my code
against HEAD. Making this available now because it's been far too long
already :) Comments/suggestions/feedback welcome. Hopefully the patch is
pretty self-explanatory; and it's only small.

-E


On Mon, Jul 1, 2013 at 9:32 AM, Edsko de Vries <edskodevries at gmail.com>wrote:

> Yes, I fully intend to create a ticket with a detailed description and a
> first patch, but I've been struggling with the latest HEAD, and
> specifically the fact that it now uses dynamic libraries for TH. I (think I
> am) stuck at a Cabal bug and I cannot currently build my code at all :-/
> Duncan is looking into this though.
>
> Edsko
>
>
> On Fri, Jun 28, 2013 at 1:43 PM, Simon Peyton-Jones <simonpj at microsoft.com
> > wrote:
>
>>  I’m confused as to details here.  ****
>>
>> **·         **Edsko is doing something; Nick is doing something else
>> (attached for completeness).****
>>
>> **·         **I can’t locate a Trac Wiki page that describes the design**
>> **
>>
>> ** **
>>
>> I’m more than happy to adopt patches that improve the plugin API, but
>> you’ll have to lead me through it!****
>>
>> ** **
>>
>> No hurry, just when you are ready.****
>>
>> ** **
>>
>> Simon****
>>
>> ** **
>>
>> *From:* Edsko de Vries [mailto:edskodevries at gmail.com]
>> *Sent:* 26 June 2013 09:21
>> *To:* Luite Stegeman
>> *Cc:* Simon Peyton-Jones; Thomas Schilling; ghc-devs at haskell.org
>>
>> *Subject:* Re: Patch/feature proposal: "Source plugins"****
>>
>>  ** **
>>
>> Hi Luite,****
>>
>> ** **
>>
>> I was fully planning on a first version of the patch yesterday, but so
>> far my efforts were thwarted by annoying problems with dynamic libraries
>> (not -- directly -- related to the patch at all). I will try again today :)
>> ****
>>
>> ** **
>>
>> Edsko****
>>
>> ** **
>>
>> On Wed, Jun 26, 2013 at 8:51 AM, Luite Stegeman <stegeman at gmail.com>
>> wrote:****
>>
>>  Any news on this? I'd really like to have this in GHC 7.8.1 so that we
>> can release a fully working GHCJS with GhcMake functionality based on it.
>> I'd be happy to help write the patch.****
>>
>> ** **
>>
>> luite****
>>
>> ** **
>>
>> ** **
>>
>> On Tue, Jun 11, 2013 at 3:21 PM, Simon Peyton-Jones <
>> simonpj at microsoft.com> wrote:****
>>
>>  Guys,
>>
>> I'm not following the details here, but I'm open to suggestions (patches,
>> even) that improve the GHC API.
>>
>> Simon****
>>
>>
>> | -----Original Message-----
>> | From: ghc-devs-bounces at haskell.org [mailto:ghc-devs-bounces at haskell.org
>> ]
>> | On Behalf Of Thomas Schilling
>> | Sent: 11 June 2013 12:53
>> | To: Edsko de Vries
>> | Cc: ghc-devs at haskell.org
>> | Subject: Re: Patch/feature proposal: "Source plugins"
>> |
>> | On 5 June 2013 13:51, Edsko de Vries <edskodevries at gmail.com> wrote:
>> | > It is a little bit messy mostly because parts of the AST get lost
>> | along the
>> | > way: quasi-quotes in the renamer, data type declarations and other
>> | things
>> | > during type checking. A more ideal way, but also more time consuming,
>> | would
>> | > be to change this so that the renamer leaves evidence of the quasi-
>> | quotes in
>> | > the tree, and the type checker returns the entire tree type checked,
>> | rather
>> | > than just a subset. I think that ultimately this is the better
>> | approach, at
>> | > least for our purposes -- I'm not sure about other tools, but since
>> | this
>> | > would be a larger change that affects larger parts of the ghc pipeline
>> | I'm
>> | > not sure that I'll be able to do it.
>> |
>> | I needed something similar.  In particular, I built a custom code
>> | generator, but now I need a similar feature for extracting information
>> | from a Haskell file (for IDE features).
>> |
>> | Since I needed to modify one-shot compilation mode I couldn't use the
>> | GHC API.  For the IDE stuff I'm using Shake as the build manager, so
>> | that also needs a customized one-shot mode.  For my current
>> | implementation I just copied and adapted the necessary parts of
>> | HscMain, DriverPipeline, etc.  That's very messy, fragile and breaks
>> | on every GHC release so I'd really like to see the necessary features
>> | put into GHC.
>> |
>> | Do you have a working patch somewhere?
>> |
>> | _______________________________________________
>> | ghc-devs mailing list
>> | ghc-devs at haskell.org
>> | http://www.haskell.org/mailman/listinfo/ghc-devs
>>
>> _______________________________________________
>> ghc-devs mailing list
>> ghc-devs at haskell.org
>> http://www.haskell.org/mailman/listinfo/ghc-devs****
>>
>>  ** **
>>
>>  ** **
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130708/3e428234/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ghc-7.4.2-frontend-plugins.diff
Type: application/octet-stream
Size: 5450 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130708/3e428234/attachment-0001.obj>


More information about the ghc-devs mailing list