-
Notifications
You must be signed in to change notification settings - Fork 15
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
Expose the new primops isByteArrayWeaklyPinned#
and isMutableByteArrayWeaklyPinned#
from GHC.Exts
#283
Comments
I'm afraid I've forgotten the latest status, according to the CLC, of the And for reference, here is a big previous discussion: #146 |
I assume it's the document in the foot note which merely raises the question:
What eventually was voted on was this comment: #146 (comment), according to which the following applies to GHC.Exts:
All that being said none of that really makes a clear proposal about how these or other future primops should be handled in regards to GHC.Exts |
@AndreasPK IMO, there is |
Personally I would prefer a wider design/agreement on how to expose primops via ghc-internal/ghc-experiment/base using a sensible module structure over use of GHC.Exts. But without time to design and implement such a proposal exposing them via GHC.Exts seems like the next best option to me. That being said I'm not adverse to adding it to ghc-experimental instead. But as I understand it the purpose of ghc-experimental is:
So if the CLC wants to stop exposing any primops from base (maybe even deprecating existing ones in the process) that wouldn't be unreasonable but then it seems unclear if these primops should still be exposed via ghc-experimental or simply remain relegated to ghc-internal. But then we also don't want to encourage dependencies on ghc-internal. Making for no obvious solution from my perspective. In light of all these complexities and unanswered questions to me the simplest and most consistent solution would be to expose those via GHC.Exts in line with existing primops and hope for someone to draw up a design for primops in the future. Ultimately the decision lies with the CLC. If the proposal is rejected however I would still welcome concrete suggestions on how to best expose these primops in particular or primops in general. |
I agree that the most sensible solution is to export it from Would that those interested in adding primops be the ones drawing up a design for primops... |
No, there was no particular CLC decision on In this particular case the primops are of primary interest for packages like |
In the long term we should move away from the monolithic That said, there's clearly work to be done to come up with a new design that answers the questions raised in this thread, and that won't happen overnight. Meanwhile, if specific new primops are sufficiently widely useful and stable enough to be desirable in |
If anyone is in favor of re-exporting these primops from |
I think new primops pop up regularly enough (this, #203, #188) that it would be great to figure out for the new primop export design sooner before the next primop is being added. I opened a GHC issue, https://gitlab.haskell.org/ghc/ghc/-/issues/25242 as I think it's more of GHC than CLC issue. |
We will add these new primops to GHC in 9.12 (https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13144) and likely backport them to 9.10 as well.
I expect them to be stable and used widely going forward and would like to avoid people depending on ghc-internal for this feature. Therefore I propose we expose it from GHC.Exts in line with most other primops.
For background on the issue see https://gitlab.haskell.org/ghc/ghc/-/issues/22255
For details about what these primops do see the changes to docs/users_guide/exts/ffi.rst in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13144
The text was updated successfully, but these errors were encountered: