Conversation
|
Labeling this T-lang because the desire to make this FFI-compatible is a lang matter. |
|
It's worth pointing out another big issue with this is that the canonical In particular, while I'm not super compelled by the argument that C supports this, therefore the standard library needs to support this. I think that guaranteeing a |
I think that polar form almost always is the more optimal form, at least in my experience. But the ABIs do use rectangular, e.g. from x86:
so it makes sense that an interchange type matches that, and users can translate to/from a polar repr at the FFI boundary if needed. But this reasoning is definitely something to have in the RFC's rationale & alternatives. |
|
Right: I guess my main clarification here was that due to the polar-orthogonal discrepancy, it shouldn't be a canonical Rust type (e.g. |
|
Thanks everyone for the feedback! I have incorporated as much as I can into the RFC. |
Clarify suggestions for complex number operations and future support.
It was there in an earlier draft, but I decided to relegate it to a future possibility. However, you can see that a related possibility such as the |
Clarified the implementation details of complex number operations and their calling conventions with C. Added explanations for arithmetic operations and discussed the drawbacks of alternative representations.
|
@tmandry I hope that all issues are sufficiently resolved? |
|
Just a remark about potential c32 and c64 aliases. I assume they refer to I like the idea that i32 is 32 bits, u64 is 64 bits etc. Using c32 for a type with a size of 64 bits may be confusing or at least, error prone for users. For instance numpy use complex128 for Choosing the most appropriate one may require additional discussion. |
To be fair, one could also argue the other way, that it may be confusing for users who may think We could theoretically discuss which one is better here, but I don't think this should block the RFC. Thanks for raising the point @lokyhark! |
If one needs a discussion to determine whether Also most prior art that provides such an alias uses
|
Yes, I agree. It would essentially be clear looking at the generic type. Besides, we should have this discussion later, given that it's mentioned in the RFC as a future possibility. |
|
@rfcbot reviewed |
|
Thanks @nikomatsakis for the review! By the way, is rfcbot bugged? It hasn't acknowledged the review yet. |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
@rfcbot reviewed Thanks @scimind2460 for putting in the work on this. |
This comment was marked as resolved.
This comment was marked as resolved.
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
|
The lang and libs-api teams have decided to accept this RFC, and it's now been merged. Thanks to @scimind2460 for pushing this forward. For further updates, see the tracking issue: |
This RFC proposes FFI-compatible complex numbers to help scientific computing library authors use non-indirected complexes.
I apologise in advance to
num-complexRendered