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

GHC ghc-devs at haskell.org
Wed Aug 16 02:51:00 UTC 2017


#5218: Add unpackCStringLen# to create Strings from string literals
-------------------------------------+-------------------------------------
        Reporter:  tibbe             |                Owner:  thoughtpolice
            Type:  feature request   |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.0.3
      Resolution:                    |             Keywords:  strings
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):  Phab:D2443
  #11312, #9719                      |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by winter):

 I don't think it's a good idea to change the string literal desguaring:
 there're too many libraries rely on the old `Addr#` desugaring behaviour,
 changing it will break them. And null terminate modified UTF-8 strings are
 useful: for example a filepath literal. It's also more compact, which is
 why we choose it in the first place.

 So no matter what, i will ask that new desugaring literals should be added
 together with a new syntax, e.g. the primitive version has already differ
 in syntax: `##` vs `#`. I would propose adding a new syntax `""...""`.

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


More information about the ghc-tickets mailing list