Skip to content

Comment on Playframework: Async, Reactive, Threads, Futures, ExecutionContextsparent

Comments

> For that you need Erlang

Because the other side of highly concurrent applications is increase complexity. Both threads and async-based _large_ applications become a mess, fast. No talking about HAProxy type small server, but complicated business rules, state machines and so on. Shared state is hard to reason in non-concurrent application, large concurrent ones, especially with shared data structures, become complicated.

That is why light-weight isolated process based concurrency is the best IMHO. Erlang is at the for-front of that. It also has a completely concurrent garbage collector (it won't stop the world) since each process also has a private heap. But as the infomercial guy says, "But wait, that's not all". Add hot code reloading and being able to schedule all these light-weight processes on any number of CPU in an m:n fashion is what takes the cake.

Aha, so is it all rainbows and unicorns. No. You pay for it by getting a sequential slow down. So if you benchmark mandelbrot or matrix multiplication on C++ vs Erlang, C++ will win. Safety and isolation doesn't come for free. So pick and choose based on what requirements you have. There is the syntax issue that people don't like so those are some trade-offs.

None of that explains why you need erlang. Any language can do message passing. The whole point is that we should be expecting these capabilities from every language, rather than pretending using an event loop is in any way reasonable.

You don't. But that is the complete package where isolation and fault tollerance was built in from the start (in the VM, the tool chain, in the libraries) and so on.

Go, Rust, DartVM, Haskell and Scala's Akka all do it. You can do it in C++ and C even. The problem is unless there is true isolation there is always a chance of global data being accessed and updated. There are lock, mutexes, barriers, etc. That is why true isolation comes in.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.