2 ms·
I get what you’re saying but it’s not fully right. In c++, the language allows you to have infinite loops. In erlang/elixir you can’t - you need to do recursion
by anko 6y ago
I get what you’re saying but it’s not fully right. In c++, the language allows you to have infinite loops. In erlang/elixir you can’t - you need to do recursion instead. This language feature makes sure that one piece of code doesn’t lock a core indefinitely.
That’s why Java/scala’s akka is crazily complicated. They encourage you to use futures so you don’t lock a core! So suddenly you’re still dealing with concurrency but with even more complicating layers.
- CyberDildonics 6y agoYour example has no overlap with what I was talking about. What you are saying is about iteration in the language and does not have anything to do with concurrency or architecture. There is also nothing difficult about avoiding infinite loops in C++. There is a for loop to iterate through a data structure, or you just can just make a macro to iterate a number of times. This is not something that would cause anyone to feel like a big problem has been solved. Recursion for iteration only has advantages when compared to loose while loops. Once more structured iteration came about, using recursion for iteration is just an awkward and overcomplicated hack that obscures something simple.
- anko 6y ago> What you are saying is about iteration in the language and does not have anything to do with concurrency or architecture. > There is also nothing difficult about avoiding infinite loops in C++. I don't know how to explain it to you if you think you get it already but you don't. Please come into the discussion with an open mind. Making sure every library you use won't ever block a core is not trivial. If it's a feature of the platform, then it becomes trivial. On Erlang it's a feature of the platform, in c++ it is not.