mthom / scryer-prolog

A modern Prolog implementation written mostly in Rust.
BSD 3-Clause "New" or "Revised" License
2.06k stars 122 forks source link

Consider rust's strict_provenance? #2019

Open rujialiu opened 1 year ago

rujialiu commented 1 year ago

Someone told me today that we should not assume C's size_t and rust's usize should be able to hold pointers because this is not the case on some emerging architectures (https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-947.pdf). Rust has a tracking issue on strict_provenance (https://github.com/rust-lang/rust/issues/95228) that seems to be related to this kind of complexity, but it looks too complex to me, and it might be too early to consider this, but I think it's a good thing to make the code more clear/reliable and ready to new architectures. So I'm opening this issue in case anyone is interested in.

rujialiu commented 1 year ago

Looking at the projects that mentioned that rust issue, I found https://github.com/google/zerocopy quite interesting. The codes that I debugged a lot during porting to 32-bit, is somewhat similar to what zerocopy tries to do. While we don't neccesary need to use it directly, we can follow its development