Skip to content

Add custom primitive / Copy types? #900

@Droggelbecher

Description

@Droggelbecher

Thank you for this great project :)

I'd love to add some custom Copy and/or primitive types to rune that should also be exchangeable efficiently with rust.
Two main examples would be:

  • f32, u32: These are used a lot in my code for GPU-related things so it would be nice if I were not forced to convert them back and forth to larger types for exchange with rune. I tried to follow the f64 code, but ultimately I cant implement Named for f32 without forking due to the orphan rule. Is there a recommended way of doing this?

  • Small coordinate vectors such as a pair of x/y coordinates. I used to do this with a custom type but it was significantly slower than a plain pair of ints. I suspect that its due user types being allocated and refcounted, is there a way to work around this limitation? (so I can have a coordinate type that is fast but also supports custom operations such as addition in rune)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions