Re:Erlang, the next Java
by KirinDave on Friday January 21, 2011 @11:17AM
(#2127762)
I had the fortune of doing a lot of work with Erlang over the last 3 years, even helping to ship a product that relied on it for some middleware. Erlang is great for some tasks, and if you don't know it (and you're of a programming discipline) you should learn it, if only to get comfortable with Actor concurrency.
My newest job requires interoperability with a lot of Java code, so I've been working with Akka, using Scala. While I haven't yet been able to examine if it really can scale the same way that Erlang does, so far its been off to a fairly good start so long as you are disciplined.
Re:Erlang, the next Java
by jcromartie on Friday January 21, 2011 @10:52AM
(#2127663)
Is the ending of this paragraph a typo or a joke?
"One way that Erlang differs from OO languages is its emphasis on failure. Any message can fail. Processes don't raise an exception, they fail. Systems are structured as worker processes at the bottom that are likely to fail, with manager processes above them that restart the failed processes. Because programmers expect processes to fail, they"
Re:Erlang, the next Java
by daleharvey on Friday January 21, 2011 @11:35AM
(#2127824)
hah if it wasnt an intentional joke then its a very good accident.
It helped me tremendously to understand error handling in erlang when I realised every line of code was a point of failure
Java forces you to handle things like FileNotFound even if you fully expect the file to be there, erlang you would not handle file not found at all, but you would manage all errors at a higher level for the entire unit of code that expected the file to be there.
Re:Erlang, the next Java
by wzdd on Friday January 21, 2011 @11:22AM
(#2127778)
Based on the fact that two other people here apparently didn't finish reading the paragraph either before commenting: if it was a joke, it was a bad one. :)
Re:Erlang, the next Java
by viraptor on Friday January 21, 2011 @11:31AM
(#2127807)
Yeah... probably a very bad one. I finished the paragraph, but thought the typo was so obvious that OP was asking about the contents really, not the silly silly typo.
Re:Erlang, the next Java
by bradfordw on Friday January 21, 2011 @11:17AM
(#2127763)
No, not a typo or a joke, the mentality of an Erlang programmer is to (and this gets beaten to death in books) "Let it crash." It is ok to let processes fail, you build restart strategies for certain processes so that when they do fail, your supervisors know: how often to try to restart, how many times and of course which module.
Re:Erlang, the next Java
by jchrisa on Friday January 21, 2011 @11:41AM
(#2127846)
If your program gets into a funky state, it's much simpler to trash it and start over, than to try to work backwards to a safe state. Sysadmins know this at the os-process and machine level, Erlang brings it to the language level. Erlang was designed for robustness, concurrency was just a happy side-effect of that focus.
Re:Erlang, the next Java
by viraptor on Friday January 21, 2011 @11:15AM
(#2127753)
It's likely that the idea was either misunderstood or not expressed properly. That paragraph is kind of true... just written in a very weird way that doesn't really show this process in a good light.
Yes, Erlang embraces failure and provides ways do deal with it by design. No, it's not a replacement for exceptions. Especially that Erlang does have exceptions to deal with the typical "could fail, so we'll just `try` it" programming.
Re:Erlang, the next Java
by arethuza on Friday January 21, 2011 @11:23AM
(#2127781)
I wonder what is the "next Java" then? JavaScript?
(NB I used Java a lot from 1995 to 2002 and I'm now a big fan of JavaScript - the appeal of being able to do client side, server side and DB coding in one language).
Re:Erlang, the next Java
by discreteevent on Friday January 21, 2011 @11:48AM
(#2127874)
I like the article's emphasis that it is the lack of shared state that is more important than the fact that the language is functional. Also it is the "mystical view" of objects that contains all the value. Unfortunately its also the baby that some people fail to see when they want to throw out the object bathwater.
My newest job requires interoperability with a lot of Java code, so I've been working with Akka, using Scala. While I haven't yet been able to examine if it really can scale the same way that Erlang does, so far its been off to a fairly good start so long as you are disciplined.
"One way that Erlang differs from OO languages is its emphasis on failure. Any message can fail. Processes don't raise an exception, they fail. Systems are structured as worker processes at the bottom that are likely to fail, with manager processes above them that restart the failed processes. Because programmers expect processes to fail, they"
It helped me tremendously to understand error handling in erlang when I realised every line of code was a point of failure
Java forces you to handle things like FileNotFound even if you fully expect the file to be there, erlang you would not handle file not found at all, but you would manage all errors at a higher level for the entire unit of code that expected the file to be there.
Yes, Erlang embraces failure and provides ways do deal with it by design. No, it's not a replacement for exceptions. Especially that Erlang does have exceptions to deal with the typical "could fail, so we'll just `try` it" programming.
(NB I used Java a lot from 1995 to 2002 and I'm now a big fan of JavaScript - the appeal of being able to do client side, server side and DB coding in one language).