|
| ▲ | Joeboy 2 hours ago | parent | next [-] |
| Maybe not what they meant, but Rust sometimes makes it tempting to just copy things rather than fighting the borrow checker. Whereas in C++ you're free to just pass pointers around and not worry about it until / unless your code crashes or gets exploited. Speaking authoritatively from my position as an incompetent C++ / Rust dev. |
| |
| ▲ | kmaitreys 10 minutes ago | parent [-] | | I see. Fortunately, I'm aware of that and I don't use clone (unless I intend to) as much. Borrow checker is usually not a problem when writing scientific/HPC code. Because passing pointers isn't as ergonomic in Rust, I do things in arena-based way (for example setting up quadtrees or octrees). Is that part of the issue when it comes to memory bandwidth? |
|
|
| ▲ | zozbot234 an hour ago | parent | prev [-] |
| Stable Rust doesn't have a local allocator construct yet, you can only change the global allocator or use a separate crate to provide a local equivalent. |
| |
| ▲ | kmaitreys 9 minutes ago | parent [-] | | Right. I have seen Zig where one needs to specify allocators as well. I'm sorry I'm not well versed enough to know how it makes things better for HPC though? For now my plan is to write fairly similar style code as one may write in C++/Fortran through MPI bindings in Rust. |
|