News for hackers. Stuff that matters.
Re:Towards fearless SIMD, 7 years later by pcwalton on Sunday March 30, 2025 @10:56AM (#43524680)
> As far as I can tell, any time you want to rely on the exact binary layout of something in memory, you need unsafe. As a corollary, any time you want to bit cast from one type to another, you need unsafe.

No, that's what bytemuck is for. If bytemuck didn't exist, sure, I'd be using a lot of unsafe.

Re:Towards fearless SIMD, 7 years later by pclmulqdq on Sunday March 30, 2025 @09:08PM (#43529582)
Bytemuck handles the latter, not the former. In the applications I am working on, both matter.
Re:Towards fearless SIMD, 7 years later by pcwalton on Monday March 31, 2025 @02:32AM (#43531813)
I can't quite parse your statement, but if you mean that bytemuck doesn't let you "rely on the exact binary layout of something in memory", then yes, it does: it lets you cast from a Pod type to another Pod type, which exposes the memory layout of both types.