Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Support for GHC < 8.6 in Preparation for PrimUnaligned #411

Open
andrewthad opened this issue Mar 26, 2024 · 1 comment
Open

Drop Support for GHC < 8.6 in Preparation for PrimUnaligned #411

andrewthad opened this issue Mar 26, 2024 · 1 comment

Comments

@andrewthad
Copy link
Collaborator

Before GHC 8.6, there are no primitives for unaligned access to byte arrays. These have now been available for a long time, and I have a typeclass and functions for this in the primitive-unaligned library at (Data.Primitive.ByteArray.Unaligned)[https://hackage.haskell.org/package/primitive-unaligned-0.1.1.2/docs/Data-Primitive-ByteArray-Unaligned.html]. The design of the typeclass needs to be changed soon since GHC is gaining primops for unaligned Addr# access, but I'd like to go ahead and start down the path of getting these consolidated. The first step toward that is removing support for GHC < 8.6.

Please keep discussing here about dropping support for GHC 8.0, 8.2, and 8.4. Any discussion about unaligned access to primitive arrays should happen at #409

@raehik
Copy link

raehik commented Mar 26, 2024

A C header macro file in bytestring bytestring-cpp-macros.h notes that unaligned byte array access primops were not always safe before GHC 9.2.2:

#define HS_UNALIGNED_ByteArray_OPS_OK \
  MIN_VERSION_base(4,12,0) \
  && (MIN_VERSION_base(4,16,1) || HS_UNALIGNED_POKES_OK)
/*
The unaligned ByteArray# primops became available with base-4.12.0,
but require an unaligned-friendly host architecture to be safe to use
until ghc-9.2.2; see https://gitlab.haskell.org/ghc/ghc/-/issues/21015
*/

(clickable GHC issue link: https://gitlab.haskell.org/ghc/ghc/-/issues/21015 )

Does this change anything for us?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants