4 ms·
I think so too. FP does not work over a distributed system, because it requires to view "the world" in one chunk. But that does not scale. Using actors is a gr
by valenterry 6y ago
I think so too. FP does not work over a distributed system, because it requires to view "the world" in one chunk. But that does not scale.
Using actors is a great way to chunk the worlds into smaller parts, each of which can then be handled in fully FP manner.
- alquemist 6y agoIt depends on what the meaning of the word 'scale' is. Analytics is definitely using a ton of FP-flavored computation at gigantic scales. The #1 principle of FP is the insistence on computation with no side effects. Relational algebra (SQL, MapReduce, Linq, etc.) is adhering to this principle, making it arguably the most successful application of FP, running some of the largest computations on the planet.
- discreteevent 6y agoThe parent wasn't talking just about scale, but distributed systems at scale. You could argue that making a call to a db is a distributed system but that is usually not what is meant. FP without side effects is excellent for transforming immutable data. History is by definition immutable so it suits that. It doesn't fit quite as well with a distributed system that has changing state, where the current state of the system is the primary concern for users.
- alquemist 6y agoObviously. Yet the 'FP doesn't scale for distributed systems' is too broad. MapReduce / Flume / Spark / BigQuery are distributed systems. What he probably meant is one can't use pure FP for OLTP at scale. This is again a bit too broad, as most systems benefit from having a FP 'business logic' core with some mechanisms to integrate with the rest of the world. Often times distributed systems are build of purely functional layers talking RPC with the lower layers. Even Erlang, the canonical example of 'we really meant actors when talking about objects' is heavily functional in its design. For reference, I use FP as in 'eschew mutable state', and not 'let's use category theory to solve FizzBuzz using compile-time type metaprogramming'.
- jadyoyster 6y agoJust a side note; it is entirely false that FP cannot work for a distributed system. You could say the same for any program that's not simply a batch computation from input to output. Luckily things like functional reactive programming exist which allow longer running programs to be written (purely) functionally. The same can be done for distributed programming. Highly recommend this blog post if you want to learn more: http://conal.net/blog/posts/can-functional-programming-be-liberated-from-the-von-neumann-paradigm http://conal.net/blog/posts/can-functional-programming-be-li...