-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Execute 128bits Hasher specs that are now passing #5380
Execute 128bits Hasher specs that are now passing #5380
Conversation
Ah, Travis CI failed 😞 Seems associated with the version of Crystal used within Docker. Will investigate. |
Ah, this will need to wait until next release. Will rebase once 0.24.1 is out. Sorry for the noise. |
@luislavena I think this can be merged now but please rebase on master to get new CI builds. |
Oops, Int128 isn't supported everywhere, as I mentioned some times already. Let's remove Int128 from the language, unless someone has an idea how to include all those missing symbols (like |
@asterite I was going to suggest exclude Int128 for x86, seems appears to be the only platform in the CI that is not supported. I don't have a solution to include these missing functions, but I would rather have it on specific platforms than not having it at all. Cheers. |
But then someone can use Int128, but when trying to run the code in another platform it will fail compilation. I prefer code to be portable instead of adding a feature that very few will use. |
Rust implements the missing functions directly in Rust: https://github.com/rust-lang/rfcs/blob/master/text/1504-int128.md#runtime-library-support |
Let's drop i128 support: it's shady, broken, target dependent and not portable... |
@asterite @ysbaddaden I have nothing against or in favor of removal, but then wonder why was added in the first place? If memory serves me well, I thought was to deal with time stuff? Is that no longer true and another solution was achieved? |
@luislavena I was just bored and wanted to see if it was easy to implement 😊 Maybe Time was a use case, I don't know. In any case, the current implementation is working well and doesn't need an Int128 type. |
@asterite |
@Sija Sure. PRs are welcome :-) |
According to the Rust RFC they needed a compiler capable of handling 128-bit integers to implement and compile the missing functions for 32-bit platforms. If we remove it now, we'd first have to re-add it incomplete again to be able to implement these functions. Since Int128 is already there anyway and at least partly working I'd suggest to avoid complications and leave it in (and this PR open). |
Well, I really want to move |
Rust has moved it's reimplementation of compiler-rt outside of it's stdlib so it can be built seperately. It could be useful to consider just building rust's compiler-rt and grabbing the int128 functions we need from there: https://github.com/rust-lang-nursery/compiler-builtins Until then i'd just gate these specs on |
It seems i128 and u128 `hash` specs were left out as pending. This change runs them as latest Crystal is cable to compute equal hashes. Conditionally run this on 64bits platforms. Ref #5276
We probably want to modify the |
I disagree: if a feature isn't available or broken on some targets, then it should be disabled for these targets, not left broken. Furthermore the rust compiler-rt port is tailored for rust and likely incompatible in some cases. i128 support may be nice, but too far to reach to even think about having anything in stdlib rely on it anytime soon —it took years of effort to stabilize in rust. |
LLVM emits the code which calls compiler-rt. It won't be incompatible. It can't be. Even if it was, software 128bit arithmetic is software 128bit arithmetic, and we could copy the algorithm at least. 128bit support in rust wasn't that much code, they just spent a year testing it. We don't have the same concept of "unstable features" rust has. |
This PR enables the spec that were already written. Lets enable them. But let's see how the story of 128 for other platforms goes when the times comes. I second that in mid term the functionality and api needs to be the same in platform and os, even at the cost of loosing some functionality (at least in the main apis). |
Conditionally run this on 64bits platforms. Ref crystal-lang#5276
It seems i128 and u128
hash
specs were left out as pending. This change runs them as latest Crystal is cable to compute equal hashes.Ref #5276
/cc @akzhan