RFC: rename bitcast to refcast, reimplement bitcast as a bitwise copy
What do you guys think of renaming the current bitcast primitive, which returns a reference of a new type to the same memory, to refcast, and having bitcast actually bitwise-copy a new value? bitcast could then be less restrictive about the types it casts, since the destination type could have less strict alignment than the source.
Intuitively I would take any 'cast' to be in place. How about a bitcopy primitive for the latter case?
My worry is that the alignment requirement for bitcast is too restrictive, and might hinder casts you'd expect to work on some platforms, for instance if an Int64 is 4-byte-aligned but a Double is 8-byte-aligned as in some x86-32 ABIs.
I guess my concern is not so much with the change to refcast which I think works just fine, but using a name that more accurately represents whats happening under the bonnet with the 'cast with copy to ensure correct alignment' case. copycast, alignedcast, or whatever. Maybe that's too much syntactic bike-shedding . . .
Change of heart on this one, alternatives aren't really preferable to keeping bitcast.
+1 for proposed changes.