-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support GHC 9.4 #69
Support GHC 9.4 #69
Conversation
@parsonsmatt Is is possible to remove the use of If you do not get to it in the next couple of days, I will have a go at doing it. |
Once I've got the work codebase on GHC 9.4 then I'll have time to come back around and apply fixups. I'd be thrilled to have less CPP for this, but I'm unsure how other approaches would potentially affect performance. Removing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but needs to be squashed down to a single commit.
Even then I would like to modify this to reduce the amount of CPP. But first I need to get ghc-9.4
.
Would you be willing to do a squash+merge on GitHub side of things? I'm not great at squashing on the CLI. |
@parsonsmatt Never mind, I will sort this out (I am really good at squashing things from the CLI). As for |
@erikd I could try and squash it up if you'd like. If you have any suggestions on reducing CPP then I can take a stab at it. |
Any update? |
Sorry, no. At work I am still using |
Alas :( |
I'd be happy to help push this forward. You requested earlier that I remove I saw a trick to |
@parsonsmatt Absolutely. Would merge and release the solution was a little nicer than the original. Had even meant to do it myself, but then life got in the way. |
@@ -65,6 +64,14 @@ import Data.Primitive.Types (Prim (..), defaultSetByteArray#, defaultSetOffAddr# | |||
|
|||
import Data.Hashable (Hashable,hashWithSalt) | |||
|
|||
import Data.WideWord.Compat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erikd I've consolidated the compat
stuff to minimize noise here. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. That is a significant improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing I would still like to address is the CPP
and ViewPatterns
use in things like say Data.WideWord.Word256.signum256
. I am sure there is a neater way to do that (in say that Compat
module).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like:
signum256 :: Word256 -> Word256
signum256 (Word256 a b c d) =
if isZeroWord64 a && isZeroWord64 b && isZeroWord64 c && isZeroWord64 d
then zeroWord256
else oneWord256
With the isZeroWord64
being defined in the Compat
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also wondering if some of the other CPPisms like this:
#if MIN_VERSION_base(4,17,0)
Word256 (W64# (or64# a3 b3)) (W64# (or64# a2 b2))
(W64# (or64# a1 b1)) (W64# (or64# a0 b0))
#else
Word256 (W64# (or# a3 b3)) (W64# (or# a2 b2))
(W64# (or# a1 b1)) (W64# (or# a0 b0))
#endif
could be lifted into the Compat
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all made more difficult because ghc-9.4
insists on being built with the Hadrian build system which complete breaks the way I used to manage installing multiple GHC versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, totally - I only did the Int128
to start since I didn't want to do a bunch of work if it wasn't to your tastes 😅 I'll port the rest over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also tbh ghcup
does work very well, you may consider adopting it? i was pretty skeptical but it is legitimately very good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can ghcup
produce a package I can install on several machines? Can I specify where it installs stuff like /usr/lib/ghc-X.Y
?
src/Data/WideWord/Int128.hs
Outdated
#if MIN_VERSION_base(4,17,0) | ||
#define ONE (wordToWord64# 1##) | ||
#else | ||
#define ONE (1##) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very silly! I cannot define:
one# :: Word64#
one# = wordToWord64# 1##
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, reduced the CPP and ViewPattern use throughout
Thanks @parsonsmatt . I have a local fix for the CI failures so I will finish this off in the next couple of days. I will almost certainly pull all these changes into my own branch, raise a new PR and then close this one. |
Closed in favor of #72 (which is getting closer and closer). |
@parsonsmatt @spacekitteh New version on Hackage. |
Thank you 🙏🏻 🙌🏻 |
Hopefully the GHC people do not break it again too soon. |
|
No description provided.