-
Notifications
You must be signed in to change notification settings - Fork 86
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
Introduce trait-driven arithmetic #191
Conversation
1d07dac
to
f8c373a
Compare
@workingjubilee FYI the rustdoc team has considered dividing up the sidebar by impl blocks, with some summary of the impl bounds between each, which might be a nicer way to solve this problem without making the API more complicated in order to improve the docs. |
@jyn514 would that perhaps cover the many duplicate entries in search, too? Fixing it in rustdoc, rather than an API change, might be my preference. |
@calebzulawski I haven't thought about search. Can you open an issue on rust-lang/rust? |
Opened this issue: rust-lang/rust#90929 |
IMO this shouldn't complicate the API much (this rough pass does a little, but I think a better version would be somewhat simpler, this is basically just a proof of concept), but I am definitely open to comparing alternatives here. |
@workingjubilee gotcha - this may make sense to merge in the meantime then, I don't know how long it will take to improve this on rustdoc's side. |
Then given that the docs right now are actively crashing user's browsers, this gets to move to the head of the line. |
Regular rustdocs for std can crash the Android browser, which is what I'm guessing what's going on. I've had it happen for various crates, too... |
Yes, and there has also been work on minimizing that from the rustdoc team. My phone can usually open Iterator now. |
f8c373a
to
620654b
Compare
This allows collapsing 5~10 instances of a function on the Simd type into 1-3 copies, at least from the perspective of the docs. The result is far more legible to a user.
620654b
to
4c99aa4
Compare
This does not eliminate the problems (there is also the matter of the explosive number of trait implementations!) but it makes things palpably lighter in terms of method documentations.
|
This PR knocks off about 500kb for the primary |
I'm still confident that, if we go this route, the traits should be broken up entirely by function or function category, and not |
That unfortunately doesn't really work when the function needs to be differently dispatched based on the trait implementation. None of the examples you cited in comparisons.rs require dispatching like that, which is why I didn't always do that. |
I'm confused--you did some of them that way, so why not all? |
The ones I could do that way, I did, |
Closing this in favor of carving this up into other discussions like in #198. |
This allows collapsing 5~10 instances of a function on the Simd type
into 1-3 copies, at least from the perspective of the docs.
The result is far more legible to a user.
Left deliberately unfinished to offer a taste of the difference
and allow the comparative angles to be discussed.