Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Byte Type: Supporting Raw Data Copies in the LLVM IR (llvm.org)
24 points by luu 5 months ago | hide | past | favorite | 5 comments


I wonder how this will work for Rust where bytes are u8 - will they special-case them ? That would look weird.

Also there are some botched examples, e.g. :

> define void @src(ptr %a, ptr %b) > { > %mem = alloca i8 > call void @llvm.memcpy(ptr %mem, ptr %a, i32 1) > call void @llvm.memcpy(ptr %a, ptr %mem, i32 1) > ret void > }

The last %a should be a %b. But you can get the idea anyway.


wouldn't byte in rust be more like MaybeUninit<u8>, to account for uninit and pointer fragments?


That means MaybeUninit would not be library-only anymore, but would need some compiler help. But yes you're right.


It already has lots of "magic" semantics and never was just a library type


Yes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: