Representation of complex numbers

The upcoming changes for flat float arrays will also affect the Complex module in the standard library, since records consisting solely of floats have an unboxed representation right now.

Is there already a plan for the transition? Will complex numbers remain records or will they be switched to the then considerably more efficient floatarray representation? The latter would presumably break code that uses record access, e.g. x.re, x.im, but I doubt this would be a terrible problem. Complex numbers are rather rarely used in practice, and any code base using this form of access can presumably be rewritten automatically with little effort.

2 Likes

The removal of the flat float array optimisation only affects the float array type. Records of floats are still unboxed, so there shouldn’t be any effect on the performance of complex numbers.

1 Like

I see, I was under the wrong impression that the runtime tag for float arrays itself would be retired. Good to know, less work for maintainers of bindings.