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

GHC ghc-devs at haskell.org
Thu Jul 30 12:35:06 UTC 2015


#5218: Add unpackCStringLen# to create Strings from string literals
-------------------------------------+-------------------------------------
        Reporter:  tibbe             |                   Owner:
                                     |  thoughtpolice
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       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 Revisions:
-------------------------------------+-------------------------------------

Comment (by nomeata):

 Well, any way to include a literal bytestring would help in avoiding the
 runtime cost. If the setup is only for `Text.ByteString`, there might be
 some dark coercing magic required to make that a vector while still
 pointing at the same `Addr#`, but it should work.

 I currently have a template-haskell based solution in
 [my repository](https://github.com/entropia/tip-toi-
 reveng/blob/master/src/BakedVector.hs) which allows me to write [this
 code](https://github.com/entropia/tip-toi-
 reveng/blob/master/src/KnownCodes.hs), which works fine for me.

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


More information about the ghc-tickets mailing list