Skip to content
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

Proposal: Rename Complex{32,64} to ComplexF{32,64} #77

Closed
eduardosm opened this issue Mar 18, 2020 · 3 comments
Closed

Proposal: Rename Complex{32,64} to ComplexF{32,64} #77

eduardosm opened this issue Mar 18, 2020 · 3 comments

Comments

@eduardosm
Copy link

This proposal would involves breaking changes and it is also a bit of personal opinion, so feel free to close it.

The names Complex32 or Complex64 may be confusing for some users, because it might mean "a complex of 32/64 bits in total" or "a complex formed by two 32/64 bit floats".

For example, numpy has complex64 (2 x 32) and complex128 (2 x 64). Pre-1.0 Julia also had Complex64 and Complex128.

In Julia 1.0 they decided to take the approach of using ComplexF32 and ComplexF64, which, in my opinion, it specifies more clearly "a complex formed by two 32/64 bit floats". This naming also has the advantage of remarking that they use float as number format.

@cuviper
Copy link
Member

cuviper commented Mar 18, 2020

Do you have any links discussing this change for Julia?

The master branch could currently accept breaking changes for the upcoming 0.3. However, this request doesn't have to be a breaking change if we also keep the existing names, just #[deprecated]. Type aliases are all interchangeable anyway, so any/all names we use are really just Complex<f64> and Complex<f32> to the compiler in the end.

IMO these names have limited benefit already -- when you're writing Complex64, and moreso ComplexF64, it's a small step to just write the fully explicit Complex<f64>.

See also #21 that wants really short names like c64 or C64. I guess that's still open to your question whether that indicates total size or component size though.

@eduardosm
Copy link
Author

Do you have any links discussing this change for Julia?

JuliaLang/julia#24647

I think the PR originally only removed/deprecated the old aliases (JuliaLang/julia#24647 (comment)), and then it was modified to add the ComplexF* aliases.

@cuviper
Copy link
Member

cuviper commented May 7, 2024

Given the large amount of existing uses, I think even deprecation would be too much churn.
https://github.com/search?q=lang%3Arust+%28Complex32+OR+Complex64%29&type=code

@cuviper cuviper closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants