Skip to content

WIP: ByteArray Literals

Andrew Martin requested to merge andrewthad/ghc:bytearray-literals into master

This lays the groundwork for ByteArray# literals as proposed in https://github.com/ghc-proposals/ghc-proposals/pull/292.

Things done so far:

  • Add appropriate data constructors and functions to Core, syntax (although there is no user-facing syntax for these literals), template haskell
  • One little failing test.

Things not done:

  • Code generation for switching on a ByteArray#. Perfect hashing is probably the way to go here.
  • Switch on ByteArray# with LLVM backend (has native support for switching on strings).
  • Code generation for byte array literals. (not referring to pattern matching here, talking about constant ByteArray# values)
  • Extensive testing.

Again, this is just the groundwork. This gets the right structure in place, so that a Haskell Summer of Candidate would have less tedious legwork to do.

If anyone has any commentary on the way this is done, let me know. I'd like to get any design-related debate out of the way before a student takes this up.

Merge request reports