Hacker News new | ask | show | jobs
by Ericson2314 2350 days ago
Functional program helps immensely, but I don't think you are describing it quite right. You cannot to distributed systems without concurrency. Even if you don't have low level synchronization failures, you still need to watch out for determinism. Fortunately we have the math for that (usually order theory).

I make this point as someone whose job is Haskell. Too many people expect awesome magic sauce and basically write the same old imperative stuff in functional programming languages: not in the small but in the large. There's still plenty of benefit of using a good language for that, but you won't get zomg auto-parallelism.

2 comments

Even coding in Erlang/Elixir (inside the BEAM VM in general) where parallelism/concurrency is a 99% solved problem and works as you expect, people still manage to fuck it up with trying their damnest to invent mutable data structures, or inadvertently make 1000 tasks wait on one green thread (when they absolutely shouldn't and there are much better solutions).

It's quite comical and sad to watch at the same time.

I agree with the article's title: we really need a new breed of programmers.

Meant that it enables concurrency and parallelism without having to worry so much about the mechanics of it, which helps take advantage of multiple cores as described in the article. Immutable data structures and pure functions avoid data corruption when two or more threads are working on the same data. OOP requires a lot of code to get the same result, true?

I'm new to FP myself and it seems like if done wisely it simplifies multi thread, parallel processing quite a bit.

I would check out https://github.com/reflex-frp/reflex which is truly a godsend for concurrency but actually uses loads of mutation internally.

Haskell helps loads here but the mechanisms are a lot more complex and nuanced than the circa 2000 ideology you were saying.