[erlang-questions] Erlang Syntax - again
Ulf Wiger (TN/EAB)
Tue Mar 11 11:09:44 CET 2008
Robert Virding skrev:
> Getting back. What do people want? Do they want something that looks
> like Java, or C++, or Python, or Perl, or ... ? This is actually
> possible to do, BUT (there is always a but) you would not have the Java
> or C++ or Python or ... semantics, you would still have Erlang
> semantics. Would we then get complaints that while it looks like Java it
> doesn't behave like Java, and why not?
I think this is a very valid question.
Differences in syntax actually play an important role in conveying
differences in semantics. Deliberately copying the syntax of another
language might lead to lots of confusion if one doesn't copy the
semantics as well.
It reminds me of one of my favorite gripes about UML. The main
point of a standard notation is that everyone should be able to
look at a symbol an immediately agree on what it means. The UML
approach has been to include everything in the standard, leading
to a huge specification that no mortal fully understands, and then
leaving enough vital details undefined so as to allow tool makers
to make their own UML adaptation with the same symbols, but slightly
Some aspects of the syntax could perhaps be polished without
falling into this quagmire of semantics confusion, though.
I haven't used Erlang as long as you have (few have, obviously),
but long enough to have developed a similar blindness to its
If I were to make some suggestions, I would perhaps choose:
- A more compact lambda notation (Haskell envy) (*)
- Record syntax improvements that make record operations more
portable across modules, and reducing the very unfortunate
- A way to parameterize receive clauses (or perhaps pattern
matching in general, but it hurts the most in receive).
(*) I will say, though, that the erlang lambda syntax is
much more obvious (if a bit verbose) than the Haskell version.
When damaged by other languages, one can stare for quite a
while at a Haskell expression and not have a first clue about
what it does, since the syntax is so different. This surely
scares people, when they could learn to love the syntax if
they only set aside a full day of intense study.
Someone said "learning haskell is hard, but /programming/
haskell is easy. In a way, I think this gives a very important
perspective on the syntax debate. It's less important what
you think of the syntax at first sight, than it is what you
think of it after a year or more. Having said that, Damien
Katz is obviously no beginner, so he ought to fall in the
More information about the erlang-questions