Comment by rllj

7 hours ago

There's `@ptrCast` as mentioned in the post, but I agree that it's not optimal. I would really like a `@transmute` builtin.

Alternatively I suppose `extern` unions do that, but again, not quite the same syntactically.

For @ptrCast I also now need to care what the language's pointer provenance model is, and AFAICT the answer is Zig didn't get to that yet. If there's some kind of @transmute then we don't need to explain why the pointer cast worked because we never wrote one so that ducks the question, which is simpler.