4 ms·
Good question. Hopefully you have not been put off by that comment. It comes off kind of harsh. She wasn't right about lack of concurrency. Go, Scala, Python,
by rdtsc 13y ago
Good question. Hopefully you have not been put off by that comment. It comes off kind of harsh.
She wasn't right about lack of concurrency. Go, Scala, Python, hell all of them I guess can do "concurrency". They all have facilities to launch concurrent requests/actors/callback threads/other processes.
Now maybe what she was going to say (and her "how much pain and when" kind of hints in that direction) is that once you start handling large scale concurrency, things get very complicated. Anything that lets you share memory will eventually bite you back in terms of debugging and downtime.
Erlang's concurrency is unique because its concurrency units are isolated. They are as isolated as possible. Each has its own memory. Garbage collection can happen concurrently. One such what they are called process will not damage or interfere with other processes. That is invaluable.
Erlang's concurrency just like (Go's and Rust's I think) is also a mix of both CPU and IO. So behind the scenes Erlang spawns an operating system thread for each CPU core and then it dynamically scales your concurrency units over them. You need to run better, just add more cores.
Another (and this should be the main differentiation) is fault tolerance. This was and is the raison-d-etre for Erlang. Nothing practical out there matches it. Processes can and will crash and Erlang has standard ways to supervise and restart. Even crazier it provides built in facilities to reload the code while the system is running. That is of course possible in other frameworks and languages but in Erlang is baked in and battle tested over many years.
That sort of makes Erlang a unique tool. It doesn't come without trade-offs. It doesn't for example has terribly fast sequential speed. So if your task is to multiply matrices for example, or computer lots of numbers. Erlang won't be the fastest in that regard. It is also a functional language. It is beautiful I think, especially if you like pattern matching, but some people don't like that.
But if you don't like the syntax, there is way out, the same Erlang virtual machine called BEAM can run other languages. For example a nice new one is Elixir http://elixir-lang.org/ http://elixir-lang.org/ check it out, it is rather similar to Ruby in syntax but includes all the concurrency features from Erlang.
As for resources I would recommend the wonderful and funny online book called:
Learn You Some Erlang For Great Good http://learnyousomeerlang.com/ http://learnyousomeerlang.com/
- blacktulip 13y agoThank you so much for the explain. Really appreciated.