5 ms·
Would it be safe to say Scala with the Akka lib offers the same robustness and distributed scalability as Erlang? Erlang is using the actor model and so is Akk
by rartichoke 14y ago
Would it be safe to say Scala with the Akka lib offers the same robustness and distributed scalability as Erlang?
Erlang is using the actor model and so is Akka.
I really want to learn one or the other as a goto functional language.
I keep looking at sites like Netflix, Twitter and Foursquare. Those seem to be sites running on either Java or Scala.
Why would they pick that instead of Erlang?
- SoftwareMaven 14y agoPragmatism. It is easier to find JVM-knowledgeable people than to find BEAM-knowledgeable people. The actor model isn't the only aspect that gives Erlang its robustness. In fact, far more important is its supervisory model, which goes as deep as you want it and can supervise across system boundaries. I keep waiting for the language that learns these lessons from Erlang with a happier syntax, but I have yet to find it.
- codewright 14y agoGoing back to the OP, does Akka provide that depth or not? Akka is a LOT more than just Actor-based concurrency.
- ericmoritz 14y agoAkka does have supervisors. If you find Scala to be a happier syntax than Erlang (eye of the beholder), than Akka is worth looking into. It appears to be directly inspired by OTP and Erlang's "let it crash" ideology.
- petrohi 14y agoIt is interesting to look at virtual machines from the prospective of what they enforce. The JVM was a huge step forward when it allowed for safer memory management. Garbage collection is possible precisely because JVM enforces its memory model. You cannot use pointer arithmetic and arbitrary casts. This helps to ensure the level of ecosystem and make developers more productive. Erlang VM enforces immutability at its core. We can call it safer concurrency management. We can combine hundreds of libraries and still maintain this safety. I would argue that if something is not enforced in the VM, but rather a is "good guideline", the ecosystem descends to the lowest safety that is enforced.
- lttlrck 14y agoI wonder how JVM garbage collection impacts real-time systems vs. Erlang.
- rdtsc 14y agoUsually badly. Erlang got one thing very right -- private heaps for each process. So when garbage collectors run they never have to stop all the processes and collect, and that is very important in types of system Erlang runs in. I know Java has "pauseless" garbage collector but I think that is just marketing talk. Given how references to objects can be shared between threads I don't see a way for it to work.
- petrohi 14y agoErlang VM is much friendlier to garbage collection. For example immutability removes one of the biggest overheads of GC--tracking reference mutations. Process isolation allows to run garbage collection concurrently and without employing esoteric techniques. Many processes are short lived and never reach GC point, when they terminated memory is reclaimed wholesale.
- rdtsc 14y ago> Would it be safe to say Scala with the Akka lib offers the same robustness and distributed scalability as Erlang? Depends why you picked Erlang. Erlang has unsurpassed fault tolerance built in. This mean ability to crash and restart individual processes, ability to hot code reloading. Its standard library by default comes with such things as a distributed application controller that will make sure you application will immediately start running on another machine if it crashes locally. I don't know of any other languages or platforms that provide that as a first class. Then for things Erlang would be used you really would want something battle tested. Eventually Akka will be battle tested and this won't be an issue but I think it is not there yet.
- rartichoke 14y agoI mainly wanted to use it to develop web apps. Everything from the server up to the business logic. I picked Erlang or Scala/Akka because both of them seem to have reasonable support for web libs and are based around distributed concurrency. Erlang was a choice because it seems to run really well on medium-tier hardware. What can be served with a single Erlang server might take 10 Python servers, etc.. I haven't seen any Akka benches but if huge crazy scale web sites are serving everything with Scala then I have to assume it's speedy. I also want to dabble in the idea of creating 2D games and I know Erlang's math computation speed isn't very good but Java's (and that means Scala too) is very reasonable. It would be nice to just learn Scala and use that for the core game engine (not 3D) logic / collision detection on the server side. I think with Erlang you would have to end up writing the game stuff in C to get reasonable performance?