4 ms·
w.r.t. concurrency: As you know, the difficulty with concurrency is with shared mutable state. Purity simplifies concurrency by restricting mutability; rust s
by surrealize 11y ago
w.r.t. concurrency:
As you know, the difficulty with concurrency is with shared mutable state. Purity simplifies concurrency by restricting mutability; rust simplifies concurrency by restricting sharing.
That makes purity less important for rust.
- kyllo 11y agoPurity is also not the same as immutability. Clojure has immutable data and impure functions, and it also offers good, safe concurrency features. Purity helps with other things as the parent comment mentioned, but it's not necessarily tied to immutability. But I maintain that purity is necessary in the presence of laziness, because it's terribly confusing to reason about side effects when you're building up thunks everywhere.
- Peaker 11y agoCan you sprinkle parallelism annotations and have guarantees about semantics not changing while gaining parallel execution? Also, note concurrency and parallelism are two of many interesting benefits of purity. I'll also add unit tests and property testing which are much nicer with purity.