[GHC] #7015: Add support for 'static'

GHC ghc-devs at haskell.org
Fri Aug 8 12:12:44 UTC 2014


#7015: Add support for 'static'
-------------------------------------+-------------------------------------
              Reporter:  edsko       |            Owner:
                  Type:  feature     |           Status:  patch
  request                            |        Milestone:  7.10.1
              Priority:  normal      |          Version:  7.4.2
             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:  Phab:D119   |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Great work.  I'm going to add some top level comments here

  * I'd love a wiki page summarising the programmer's-eye-view of the
 design; and sketching the implementation.  You may say that the
 programmer's eye view is in the paper, but (a) that's less accessible, and
 (b) details change, such as the type, which you have called `Ref`.

  * Bikeshed: I don't that is at all a good name... sounds mutable to me.
 I don't think `Static t` so bad.  `StaticName` is ok, as is `StaticPtr`.

  * The type checker is not supposed to do program transformations like
 floating bindings to top level.  It should be possible to display the
 output of the type checker in an IDE, exactly as the programmer wrote it,
 fully decorated with type information.

  So I think it'd be better if the desugarer did the floating, not the type
 checker.  That should not be a hard change to make.

  * I don't understand `checkStaticValues`.  The typing rule for `static`
 in the paper is quite simple, so what is going on here?

  * What is `addrToAny#` and where is it documented?

  * I'm pretty convinced that static values (`Refs`) should come with a
 `TypeRep` -- or at least the fingerprint of a `TypeRep` so that we can
 reject bogus values.  That wouldn't be hard, would it?  The merit of
 having a `TypeRep` tree rather than just a fingerprint is that the error
 message might be more informative.


 Simon

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7015#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list