Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Use an actor model language -- by far the sanest way. Message passing is intuitive to human experience.

1. Elixir (Erlang)

2. Scala/Akka

3. Pony



I am biased because this is my research area, but I have to respectfully disagree. Actor models are awful, and the only reason it's not obvious is because everything else is even more awful.

But if you look at e.g., the recent work on task-based models, you'll see that you can have literally sequential programs that parallelize automatically. No message passing, no synchronization, no data races, no deadlocks. Read your programs as if they're sequential, and you immediately understand their semantics. Some of these systems are able to scale to thousands of nodes.

An interesting example of this is cuNumeric, which allows you to take sequential Python programs that use NumPy, and by changing one line (the import statement), run automatically on clusters of GPUs. It is 100% pure awesomeness.

https://github.com/nv-legate/cunumeric

(I don't work on cuNumeric, but I do work on the runtime framework that cuNumeric uses.)


>the recent work on task-based models, you'll see that you can have literally sequential programs that parallelize automatically

Can you provide some details please? I am not quite clear what you mean.


If you really want to dig into it you can read up on the tutorials and/or papers from the Legion project: https://legion.stanford.edu/

But briefly, these task-based programs preserve sequential semantics. That means (whatever the system actually does when running your program), as long as you follow the rules, the parallelism should be invisible to the execution of the program.


While not for clusters AFAICT, Rayon (Rust lib) auto parallizes loops. It is used in Programming Rust by O'Reilly in a great example. Forgive the RESF response please.


It is a pity Concurrent ML didn't take off. F# has a great library called Hopac that implements it, but it is 50 times less popular than its closest competitor Rx.

Also seconding that other post. Actor models and async concurrency are only useful if you need to send messages between machines, but otherwise you want to use synchronous concurrency as it is easier to deal with.


It’s not always easy, things can get confusing when you start sending messages to yourself


Came here to say just this. In particular, _immutable_ message passing.


4. D




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

Search: