A Pythonista's Impressions of Erlang
Corrado Santoro
csanto@REDACTED
Tue Jan 11 18:24:29 CET 2005
Some few words on this, from a guy who wrote projects both in Python and
Erlang.
> http://llimllib.f2o.org/blog/serve/entry/erlang
> No String Type: Let me repeat this for emphasis:
> There Is No String Type In Erlang. Arrrggggh! Why would you do this?
IMHO, I didn't suffer for a lack of a python-like string type in Erlang.
Functions in module "lists" are quite complete and comparable to those
of the "string" python module. If I should say that something is
missing, I would refer to the python slicing capability, i.e.:
a="Hello, World"
a[5:-3] --> ", Wo"
> Error messages: Erlang's error messages are totally undecipherable
for > a newbie.
> ** exited: {undef,[{shell_default,length,[[1,2,3],12]},
> {erl_eval,do_apply,5},
> {shell,exprs,6},
> {shell,eval_loop,3}]} **
> Got it?
Yes, indeed, a more verbose exception trace could be better.
> Documentation: Most of the links to documentation on erlang.org are
> broken.
Really? I didn't find any broken link. And you?
> The; Punctuation. Is, Weird ->: Maybe this is one of the not sure
> things, but I'm pretty sure I don't like some of Erlang's punctuation.
> I don't mind the '->', but I oftentimes have to look at the docs to
> figure out whether I should be using a ';' or a '.' to end a
> statement.
I don't agree. The ';' has a precise semantics, because it means a logic
"or" (like in Prolog). So using ';' to end different function clause
means to activate this OR that clause. The '.' is a natural symbol to
specify that a function definition (with all of its clauses) is ended.
I know that the misuse of ';' and '.' is a common cause of syntax
errors, but similar situations also happen in C. Many students of mine
forget to end a statement with ';', others wrongly place the ';' at the
end of a 'for' or 'while' statement, i.e.:
for (....) ; <------!!!!!
{
...
}
and so on.
Finally, I would make a personal note on object-orientation. Erlang is
not OO, but I think that such a feature---and in particular the
inheritance---could be useful above all for beahviours.
Cheers,
--Corrado
--
======================================================
Eng. Corrado Santoro, Ph.D.
University of Catania - Engineering Faculty
Department of Computer Science and
Telecommunications Engineering
Viale A. Doria, 6 - 95125 CATANIA (ITALY)
Tel: +39 095 7382380 Fax: +39 095 7382397
+39 095 7382365
+39 095 7382364
EMail: csanto@REDACTED
Personal Home Page:
http://www.diit.unict.it/users/csanto
NUXI Home Page:
http://nuxi.iit.unict.it
======================================================
More information about the erlang-questions
mailing list