Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

(if anything!) I picked up Erlang last night again because I ran into a problem in Project Euler that I thought would be a perfect fit. After about a short time of coding, I had a solution that was extremely simple and elegant (for something I created) -- the main function being only a few lines.

My question is what is keeping people from adopting Erlang more?

  • For current developers, what do you feel is missing to increase adoption (libraries, language features, IDE/toolsets)?
  • For people who tried but were turned off by the language -- what aspects were difficult to understand or missing, or did you find a functional language that was better suited for your tasks?
share|improve this question
2  
I'll let you know once I've finished "Programming Erlang" and "Seven Languages in Seven Weeks". At the moment, I'd guess it's because multi-core, high-resilience code is considered very difficult to achieve in Java/C++ and so, by faulty extrapolation, must be hard in other languages too . –  Gary Rowe Dec 12 '10 at 22:50
    
@Gary: Thanks I'll have to grab that SLSW -- I've been meaning to look at Ruby and Haskell. –  Watson Dec 13 '10 at 14:18
    
It's definitely a good read - quite an eye opener if you're from a Java background. Out of curiosity which Project Euler problem were you tackling? Might be good to add a link for interested readers. –  Gary Rowe Dec 13 '10 at 15:27
add comment

closed as not constructive by Jarrod Roberson, maple_shaft Jul 14 '12 at 12:54

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

7 Answers

Erlang is very nearly a WONDERFUL language for massively concurrent systems. There are two factors that turned me away from it.

The first is the OTP library, which seeks to protect programmers from many of the complexities of parallel programming, at the expense of introducing a blocking metaphor that reduces the effective parallelism. Sooner or later you will find cases where using gen_server just plain stops you doing what you want to do, for no good reason other than a sort of early Apple mentality - "you don't need to do that".

The second problem, and to me this is far more significant, is that run-time error reporting mechanism is abysmal. Erlang's loosely-typed operation means that it is entirely possible to discover errors only at run time. Erlang then offers a fairly complex backtrace, but fails to mention which line of a file caused the program to barf. Instead, you usually get a message similar to "badargs in handle_call/3". Now, handle_call is a gen_server callback function, and due to erlang's pattern-matching on function parameters to select a particular instance of handle_call, you may have a dozen or more functions that match "handle_call/3". An error that would take 5 minutes to fix if you knew the line that caused the failure regularly turns into a three hour headache.

Erlang's proponents say "keep your functions simple" and test as you go along, but in a real world exercise doing a big system integration this problem made me decide to walk away from erlang programming until the language has matured a little.

I'm hoping to go back to erlang at some point - it completely fits the way I program concurrent systems - but that won't happen until the language developers climb down out of their ivory tower.

share|improve this answer
    
thank you for your detailed answer -- I agree with your qualms about the error reporting. –  Watson Dec 13 '10 at 15:05
3  
"... made me decide to walk away from erlang programming until the language has matured a little." - LOL, Erlang is older and more matured than Java. You make mine day. Thanks. –  Hynek -Pichi- Vychodil Dec 13 '10 at 23:56
3  
@Hynek, interesting that you should assume that I'm a Java programmer :-) I believe Erlang has great potential, but it needs a better infrastructure. For example, it has an incredibly powerful parse-transform system (effectively macros on steroids), but all the official documentation warns you not to use it, and you have to reverse-engineer the compiler to work out how to turn source code into the next level down parsed code. In terms of debugging, Erlang is barely better than Borland Turbo C in the late 80's. –  geekbrit Dec 14 '10 at 14:21
4  
The most recent version of Erlang now includes line numbers in stack traces –  Zachary K Jan 10 '12 at 14:54
2  
@Hynek-Pichi-Vychodil, age != maturity –  Malfist Jun 5 '12 at 18:08
show 1 more comment

Most programmers are used to concepts in languages like C++ and Python. Erlang, Haskell, and other more advanced languages are radically different from the common paradigms and have a higher learning curve. To justify that extra work, the language has to be able to offer something new to the developer.

Java was widely accepted because Sun marketed it as the language of the Internet. Similary Erlang would have to market itself for some other new domain, presumably cloud computing or multicore processing. So a toolset that focused on those new domains would "sell" the language better.

share|improve this answer
1  
The talks / papers that appear on InfoQ (by Joe Armstrong) seem to be positioning Erlang to fill exactly this gap -- cloud computing and multi-core processing. –  Watson Dec 13 '10 at 14:21
    
@Watson: actually, descriptive languages are a natural fit for parallelism, because you let it up to the compiler. It also turns out that pure functional languages (like Erlang or Haskell) also make it "relatively" easy to implement (by comparison with a language in which you'd have to share mutable state). As Tony Hoare put it, don't communicate by sharing, share by communicating. –  Matthieu M. Dec 13 '10 at 20:25
add comment

Most people seem to be scared off by functional or declarative programming. I think people fear this kind of programming model because it doesn't fit how they're used to doing things in a procedural world. "It's not how computers work," I hear them protest.

Erlang does actually have a couple of real-world problems that make it hard to apply to things like web development: It's notoriously bad at string processing, for example.

As far as I've been able to tell, it has more than enough libraries available to do just about any task, and a good text editor is all you really need to work with it. Exceptions and error reporting is very good. I can't find a reason for it to not be popular.

share|improve this answer
    
Agreed -- it has gotten a bit sticky when I've attempted to do string processing. Also I have given a talk on Erlang before (to beginners) and it was very difficult to just get beyond explaining what FP was in the first place. –  Watson Dec 13 '10 at 13:12
1  
actually, up until now, I've recoiled from Haskell because of the theory behind it. I like to understand what I am doing, and I must admit that I have a hard time grasping the theoritecal concepts that led to the functional programming family. I'll just keep trying I guess :) –  Matthieu M. Dec 13 '10 at 20:26
2  
@Matthieu M.: If you just don't bother trying to understand what an endofunctor is, Haskell is easy to learn and use. The math behind it is really just a bunch of intellectual masturbation that underpins some useful ideas. –  greyfade Dec 17 '10 at 19:49
1  
Actually Erlang does quite well for Web Development. The string handling thing is not too hard to work with –  Zachary K Apr 27 '12 at 10:16
add comment

Well Erlang seems to me like another LISP dialect or another powerful language.

The problem with such languages is that they are more on the side of the computer than on the programmer.

By that I mean that a language NEEDS to be as concise as possible, simple for a human to understand and not too mangled.

A programming language is much like a spoken language, the simpler it is, the better it is.

Esperanto is much like that.

Make an automated machine do what you want is already hard if you think about today's computer capacities, you won't do something in ASM. The best programming languages are the one which make good code, quickly for an average programmer, and is easy enough to learn.

You must understand that heavily multi threaded and/or clustered systems requires non-trivial programming paradigm and that common languages aren't suited for those particular uses.

What you have to hope, is that new concepts which are nice to understand and to use will one day find their way into common languages.

Go is such an example. Also remember that lambdas and pairs will be available in C++1x, with a lot of new stuff...

share|improve this answer
1  
Functional programming is just as easy to understand once you take time to learn it, and Erlang is readable, although its syntax is distinctly different from the "C-style" that most programmers are used to. –  syrion Dec 13 '10 at 13:49
1  
"A programming language is much like a spoken language, the simpler it is, the better it is." - agreed but isn't there a limit to this -- the sacrifices made for simplicity have to come from somewhere (lack of expressiveness, performance, etc). If the solution is to dumb it down for dumb-down's sake, then I'd rather see the language fade into obscurity. –  Watson Dec 13 '10 at 14:24
    
It depends on what kind of task you need your program to execute. Computer can't really think like humans do, they are very Cartesian absolute machines. A language is like a portal from the human world trough the computer world. Most of the time we need task which are computer oriented, but other times, more specific use of a computer machine need more advanced languages. You could call it a more powerful language and that's not false, but don't forget computers are useful when we agree with them. If you wanted to do more, you would need a neuron-networked computer machine. –  jokoon Dec 13 '10 at 15:14
    
But we are currently struggling to have more and more cores on a single CPU (if we could call a core some kind of neuron), but to have a true ai, we would need to have much more cores. I don't know how is this field of research now, but that would be interesting. –  jokoon Dec 13 '10 at 15:16
    
I'm sorry, but Lisp is the original high level language. It's wrong to say it's on the side of the computer. The first to include garbage collection, closures, and a bundle of other really high level features. Yeah Lisp has crappy syntax in the general view of programmers, but it's not low level in the slightest. And the reason why Lisp looks as odd as it does is to implement syntactical macros, another high level feature that's wandered back into Haskell and Scala in a uglier form –  jozefg Sep 28 '13 at 2:50
add comment

I believe that people generally fear what they do not understand. As mentioned in other posts on this question concepts in Erlang are not generally understood by developers that are used to languages like C, C++, C#, and JAVA. Functional languages are gaining in popularity and even Erlang is gaining some traction; however none of these things matter until a huge community gets behind the language.

Look at what happened to Ruby and its evolution following the development and release of Rails. What Erlang needs is a Rails framework similar to lift for Scala and for some folks to build large scale web sites with it to show is usefulness outside of the telecommunications industry.

share|improve this answer
add comment

I believe it is a great language/application development platform that solves really hard problems very easily. But it accomplishes that through vastly different paradigms than what most programmers are currently accustomed to. Additionally, the Prolog-inspired syntax is very different.

I wish more developers could get past these things.

share|improve this answer
add comment

I've bought the 'The Pragmatic Programmers' 'Programming Erlang' by Joe Armstrong and 'Erlang/OTP Plattform für massiv-parallele und fehlertolerante Systeme' by Pavlo Baron (The one and only german book about this language I know so far). I really do not get used to this cryptic language. Armstrongs book seems to be better for the understanding than Pavlo Baron's book but I have a hard time to understand nearly everything that seems to be essential of this language. I've read the chapter about 'Sequential Programming' twice and I wish I could use some kind of debugger that stepwise runs through the code to see what it actually is doing. The names of the 'so called' variables or bounds do not really help to get, what is happening.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.