There was so much buzz about Erlang on reddit and elsewhere lately that it all made my actually try it out. The first impressions - contrary to the rumors, it is definitely not The Next Big Thing, and well - it simply sucks.
Now a short list of things that really suck about Erlang - just the stuff you'll encounter in the first few minutes:
- Lack of basic Unix decency - no man page for erl or erlc (at least in the Ubuntu package), they do not accept --help, one cannot exit by ^D. These are very basic things. If they're broken, people are likely to leave.
- Interpreter is terribly underpowered - in most languages you can write pretty much any code in an interpreter. In Erlang you cannot even define functions there. Of course there is no online help. At this point I was pretty much willing to leave, but I forced myself to go a bit further.
- You actually have to compile your code, by hand, before you can use it - if you wrote a hello_world.erl, you have to compile it using erlc, then run erl, and call hello_world:whatever. If you made a mistake, you need to exit the main loop (by halt()., not ^D, to waste more of your time), correct the mistake, recompile, and start again. It is so unbelievably lame that I can't imagine anyone except for C++ programmers being able to put up with it.
- Don't Repeat Yourself ? Nah - In Erlang you have to repeat yourself a lot. In every file you need to write module name and list of all exported functions. And when you use them you have to prefix them by module name anyway. So even though foo:bar() simply has to be function bar in module foo, you have to explicitly list in on the export list in foo.erl anyway.
- It is not even marginally object-oriented. I'm not talking about having to hack object-orientation on top of it - it's just that basic object do not know what they are. Lists of numbers cannot tell themselves apart from strings and so on. Writing "Hello, world\n" out will actually output [72,101,108,108,111,44,32,119,111,114,108,100,10].
- String support is horrible - As I said, strings do not exist as first-class objects, they are emulated by strings. So no Unicode. No regular expressions. No high-level string functions. We're back to C.
- Not Invented Here Syndrome - Erlang tries it very hard to be different than everything else. Syntax is different (somewhat Prolog-like), Unix conventions are disregarded, standard data types (strings, arrays and hash tables) are not provided, even io:format uses its own format strings instead of following printf. You cannot simply take a look at a few examples and start writing useful programs like with Ruby, Python or even Java. Not following conventions wastes everyone's time.
Now I don't care much about Erlang, but those of you that do, here's my proposal:
- Conform to the basic Unix conventions like ^D, man pages, and --help.
- Throw away the old syntax and add something Python/Ruby-like. This isn't Lisp - weird syntax doesn't give you anything. Writing a decent parser in ANTLR is just one evening, and you don't have to throw away the old syntax, just provide an alternative. When you're at changing syntax, make it possible to access full language from the interpretter and limit the repeating yourself part a bit.
- Write a decent standard library - real strings with Unicode (not this lists of integers hackery), regular expressions, arrays, hash tables and so on.
- There is absolutely nothing that forces compilation by hand. Make it automatic by default.