Sunday, June 19, 2011

Erlang could be much better, in fact

Since joining Yandex as an Erlang programmer couple of months ago I've developed strange attitude to the language and its framework. While being almost perfect language, Erlang has a couple of things that drive me mad.

First is the lack of return statement. Almost every sequence in which steps depend on previous data results in the terrific indent-ladder of nested case statements in which you go deeper with the usual order of things and then back to column 0 with error clauses and 'end's. Why, for God's sake, I'm not able to write all that in sequential, non-spaghetti manner, returning from function on errors? Return statement doesn't break the rule that everything should evaluate, and Erlang is not a purely functional language for it to be a blasphemy.

Then, dynamic typing in couple with non-informative exceptions is awful. I've spent enormous amount of time trying to find out where that goddamn 'badmatch' occurs and, more important, who generated the bad data. Exception contains only the data to be matched and not the pattern itself, and call stack knows nothing about message passing and OTP. Let alone record syntax in exceptions. Real, real pain in the ass.
Speaking about message passing: generally, there's no possibility to trace a message to receiving process or backwards, you can't even determine a caller function in gen_server:call handler without lots of black magic. I understand that a philosophy of Erlang states that it doesn't matter who send the message, but why they make that philosophy into religion?

After all, I really love Erlang. It is a wonderful language with a wonderful community, and I think that all of its problems are mainly because it was initially developed deep inside Ericsson without public feedback. I'm providing one now, actually.

1 comment:

  1. I do not belive in languages with no DI.

    ReplyDelete