4 ms·
Out of my depth here, but I think functional languages are relevant to distributed/concurrent programming because they tend to provide (and enforce) explicit wa
by JackC 14y ago
Out of my depth here, but I think functional languages are relevant to distributed/concurrent programming because they tend to provide (and enforce) explicit ways to avoid or manage side effects and mutability. They're likely to be very different at an interpreter/compiler level from a language that happens to allow you to avoid side effects and mutability, but isn't designed to know when you're doing that or to optimize for it. (I'm thinking, for example, of the insane way Clojure implements dictionaries under the hood in order to efficiently copy them rather than edit them in place, which in turn enables its approach to efficiently rolling back and retrying operations that contend for the same shared transactional memory.) The upshot is that an imperative language like JavaScript will let you borrow some nice techniques from the functional world, but won't have a lot of the benefits of a language that's designed to only be used that way.
Again, no idea what I'm talking about, that's just the impression I have from the little I've learned about functional programming so far.