rust-lang / rust-lang/rust

Vibe check: can `Simd<T, N>: Receiver<Target = T>`?

Open
#156,270 14 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

F-arbitrary_self_types F-trait_alias I-lang-nominated I-lang-radar P-lang-drag-3 PG-portable-simd T-lang T-libs T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

In project-portable-simd, we're trying to come up with a good API for Simd<T, N> where we have much of the API split up into traits so there aren't tons of inherent methods on Simd itself to avoid overwhelming docs readers with hundreds of methods that only work for some element types. After several attempts of implementing all the traits with Self = Simd<T, N> and running into issues trying to use related types with different element types but the same length, it occurred to me to instead implement the traits directly for the element types and have methods use self: Simd<Self, N> which is slightly odd but makes the API waay nicer.

We want to get a vibe-check from t-libs and t-lang that implementing Receiver for Simd and Mask is ok.

Zulip thread on design proposal
the corresponding PR: rust-lang/portable-simd#493

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked Zulip design proposal and the corresponding portable-simd PR #493. The issue seeks t-libs and t-lang feedback on the proposed Receiver implementations for Simd and Mask; done means reaching a decision on whether that API design is acceptable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.