Functional programming has many benefits outside of concurrency. However, I believe that concurrency will be one of the biggest driving factors to adopt FP. One of the reasons why we don’t see consumer-level computers with 100+ processors is because developers simply don’t know how to take advantage of this kind of hardware.
One of the key reasons why FP is great for concurrency is that it advocates immutability. If state can't be changed, then race conditions disappear. This and other features allow developers to work at higher levels. When building large-scale distributed systems, devs can’t be concerned about menial problems such as memory management and exception handling. There are bigger and more important problems to solve. We really want to spend our time working on the overall architecture of our apps.
One thing to note is that Swift is not an FP language. It, however, incorporates many FP techniques. Looking back on the past decade, many third-generation languages have been doing the same. Just about any major language supports blocks, closures, lambdas, or whatever else you want to call them. It’s nice to see this adoption, but it’s not enough if we want to see truly concurrent systems.
Just like Jason mentioned, there are many great books on PragProg for FP. Scala and Clojure are great languages. For more than a year I’ve been working with Erlang and Elixir. (
http://pragprog.com/book/elixir/programming-elixir http://pragprog.com/book/jaerlang2/programming-erlang) I chose them because I love building occurrent systems, and I believe Erlang/Elixir can achieve better scale than other languages. However, there are many other great FP languages available such as Haskell or Lisp. Feel free to pick any one you like. Even if you don’t use an FP language as your main language, it will change and improve how you program in other languages.
..............................................
ROBERT BROWN
..............................................
iOS Developer / Software architect
..............................................
..............................................
..............................................