Skip to content

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

@programmerjake

Description

@programmerjake

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-arbitrary_self_types`#![feature(arbitrary_self_types)]`I-lang-nominatedNominated for discussion during a lang team meeting.I-libs-nominatedNominated for discussion during a libs team meeting.PG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)T-langRelevant to the language teamT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions