Hacker News new | past | comments | ask | show | jobs | submit login

> Maybe I am misunderstanding you but Erlang -- and thus Elixir -- has the best actor system invented so far.

I would sigh off on that, and yeah, I think you misunderstood me.

> Yep, I've been quite exposed to [almost] pure FP for 4 years and something now -- by working with Elixir.

That surprises me. I'm not sure we use the same terminology. There is no "almost" pure. Immutability and passing around functions is nice, but it is really only 10% of functional programming. Mind that many languages call them "functional" nowadays, but the original meaning is actually different - it's about referential transparency. I'm not aware that Elixir supports that in a meaningful way, especially since you said you did it for 4 years.

See also: https://elixirforum.com/t/thinking-functional/1771 or https://news.ycombinator.com/item?id=14849474

So for what I'm writing next, I'm just assuming that what you did is using immutable datastructures and avoiding mutation of variables etc.

If someone comes to me and wants to learn actorsystems, I can direct them to either Erlang/Elixir or Scala (with Akka). But honestly, Scala+Akka makes it difficult to fully embrace actors and is just... inferior. I would always recommend Erlang/Elixir and would even go so far to say, that most people probably don't really learn to think in actors if they pick Akka.

For pure FP however it is the opposite. If you have not written any slightly bigger program in Haskell or Scala using FP, then you also haven't understood the concept. If you don't already think in pure FP, then you will have a hard time to learn it when writing Elixir.

In Scala, the situation is much better, but still not optimal _for learning_ pure FP. I suggest you to look into Haskell again when you feel in the mood to tease your brain a bit with a new style of programming. Pure FP is as different from using Elixir/Actors as Exlixir/Actors is different from writing python. You have to think different.

For me, both Actors and oure FP are actually techniques that complement each other very well. Pure FP is good for writing all the code _inside_ of an actor. It makes reasoning and concurrent programming much easier compared to having a lot of really small actors. On the other hand, pure FP does not scale - once you cannot stay in your own small "bubble", you need a concept to go beyond. Be it to work with multiple machines, deal with elegant recovery from hardware problems or network problems between bigger parts of the system, or simply load and messaging problems. I don't know anything that is better suited than the actor model here. I hope that eventually we will have a VM like the Erlang VM with a language that supports pure FP as well as Haskell does. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: