[GHC] #5218: Add unpackCStringLen# to create Strings from string literals

GHC ghc-devs at haskell.org
Fri Jun 17 12:01:26 UTC 2016


#5218: Add unpackCStringLen# to create Strings from string literals
-------------------------------------+-------------------------------------
        Reporter:  tibbe             |                Owner:  thoughtpolice
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.0.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Runtime           |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #5877 #10064      |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonmar):

 Hmm, this seems a bit dodgy.  The RULE is not semantics-preserving
 (deliberately, I know), so if you use `viewCString#` you get a non-
 deterministic result that depends on whether optimisation is turned on and
 whether the RULE fired.  I suppose the idea is that you hide the non-
 determinism behind a layer of library code, but still, I'm not keen on
 having non-deterministic primitives.

 What's wrong with the approach in #10064 to have string literals of type
 `(# Int#, Addr# #)`?

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


More information about the ghc-tickets mailing list