by hopia · 6y ago · 0 comments
> it doesn't help with exploiting more cores.
Yeah you're right, I believe the aim is to get rid of those garbage collection pauses for better concurrency (not parallelism).
From what I understand, GHC can do pre-emptive or cooperative scheduling. Pre-emptive being better for concurrency, just like Erlang does it.
It works really well and intuitively I would say, and even more; this is a common application to show the advantages of functional programming. Here is an article comparing sending messages asynchronously between threads in Elixir and Clojure (two common functional languages) https://bentomi.github.io/posts-output/2017-06-04-message-se...
Moreover, I was mainly referring to using the actor model in a language with a static type system of functional languages (ML). What would be the type of the mailbox? The message? I believe even Facebook (Whatsapp) has struggled to find a solution to this question, they're developing a statically typed language on top of BEAM right now.
There's been plenty of good discussion around implementing a strong static type system around BEAM, here's some bits for reference: https://elixirforum.com/t/how-hard-would-it-be-to-have-a-str...