Using functional design for concurrency

Concurrency forces the programmer to be more careful about information sharing. This difficulty coincidentally encourages good functional programming practices, such as immutable data and pure functions; when computation is not context-sensitive, it tends to also be thread-safe.

Functional programming sounds great for concurrency, but are there downsides?

In one example of good intentions with bad effects, during development of a functional language called Haskell, the development team (https://www.infoq.com/interviews/armstrong-peyton-jones-erlang-haskell) wanted to make programs run faster using concurrency. Due to a unique trait of the Haskell language, it was possible to run all expressions and ...

Get Hands-On Functional Programming in Rust now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.