[GHC] #10382: Template Haskell (non-quasi) quotes should work with stage 1 compiler

Simon Peyton Jones simonpj at microsoft.com
Fri May 8 14:08:06 UTC 2015


Edward (Yang)

I'm on a train so can't say this on Trac.

I'm OK with enabling quotes (*not* quasiquotes) in stage1.  Both typed and untyped quotes should work, correct?

I'd rather it was done by using TemplateHaskell, and complaining if you use splices or quasi-quotes in stage1.  (That is very much what happens now.)  No new flags.

Could the user manual briefly mention this?  (Briefly because most users won't even know what a stage1 compiler is.)

Could you add a Note somewhere appropriate to explain this?
Perhaps mention the ticket, because Edward K's motivation is useful.
Refer to the Note anywhere appropriate.

Go for it.

Simon



| -----Original Message-----
| From: ghc-tickets [mailto:ghc-tickets-bounces at haskell.org] On Behalf Of
| GHC
| Sent: 05 May 2015 16:06
| Cc: ghc-tickets at haskell.org
| Subject: Re: [GHC] #10382: Template Haskell (non-quasi) quotes should
| work with stage 1 compiler
| 
| #10382: Template Haskell (non-quasi) quotes should work with stage 1
| compiler
| -------------------------------------+-----------------------------------
| --
|         Reporter:  ezyang            |                   Owner:  ezyang
|             Type:  feature request   |                  Status:  new
|         Priority:  normal            |               Milestone:  7.12.1
|        Component:  Template Haskell  |                 Version:  7.11
|       Resolution:                    |                Keywords:
| Operating System:  Unknown/Multiple  |            Architecture:
|  Type of failure:  None/Unknown      |  Unknown/Multiple
|       Blocked By:                    |               Test Case:
|  Related Tickets:                    |                Blocking:
|                                      |  Differential Revisions:
| Phab:D876
| -------------------------------------+-----------------------------------
| --
| 
| Comment (by ekmett):
| 
|  The current situation:
| 
|  On one hand I have a number of packages that provide `TemplateHaskell`
|  convenience functions for users, `lens` being the go-to example. But on
|  the other hand, I have a bunch of folks who maintain releases for my
|  packages on platforms where only a stage1 compiler is available, Joachim
|  Breitner and the Debian folks used to maintain patches and versions of
| my
|  code that removed large chunks of the libraries to build on those
|  platforms.
| 
|  When i found out, I offered to support stage1 compilers myself more
|  directly. This ensured a more uniform API, and that different
|  distributions weren't crippling my code in different ways, making it so
|  certain combinators or modules just weren't available on certain
|  platforms.
| 
|  But then we ran into an issue, we needed to generate names that linked
| to
|  the right places within our code. So we manually construct all of our
|  names ourselves, using the cabal-supplied version number or package key
|  when needed:
| 
| 
| https://github.com/ekmett/lens/blob/9a247b52ed20e578d9c843d8cc6dad5433a1c
| 186/src/Control/Lens/Internal/TH.hs#L104
| 
|  Then we just don't use the TemplateHaskell extension ourselves, despite
|  linking against the `template-haskell` package and everything is good
|  enough for us to limp along.
| 
|  I would love to eventually be able to drop this set of hoops, but I have
|  few opinions on the best way to get there. That said, Edward's
| suggestion
|  of making TemplateHaskell just bomb when you reach a splice site in
| stage1
|  rather than immediately would avoid introducing any new flags and sounds
|  pretty simple.
| 
| --
| Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10382#comment:6>
| GHC <http://www.haskell.org/ghc/>
| The Glasgow Haskell Compiler
| _______________________________________________
| ghc-tickets mailing list
| ghc-tickets at haskell.org
| http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-tickets


More information about the ghc-devs mailing list