rayon-rs/rayon ? reverse-engineered prompt
Reverse engineered prompt
Build me a Rust library that makes it really easy to speed up CPU heavy code by running work in parallel, without making people manually manage threads or worry about data races.
The main experience should be that someone can take normal iterator code and make it parallel with a small change, like using a parallel iterator instead of a regular iterator. It should work for common things like map, filter, reduce, sum, collect, and processing slices or vectors. If the code compiles, users should be able to trust that it won’t introduce unsafe shared memory bugs.
Also include ways for more advanced users to run two tasks at once, create scoped parallel work, and use a custom thread pool when they need control. Add clear docs, examples, and a small demo that compares sequential versus parallel behavior. Please make it feel lightweight and idiomatic for Rust, with good tests and simple setup through Cargo.
Are you gonna build this?
make sure you review the code using coderabbit