Maybe Erlang is OO after all?

Jonathan Coupe jonathan@REDACTED
Mon Aug 25 19:51:41 CEST 2003


----- Original Message -----
From: "Joachim Durchholz" <joachim.durchholz@REDACTED>
To: <erlang-questions@REDACTED>
Sent: Monday, August 25, 2003 10:22 AM
Subject: Re: Maybe Erlang is OO after all?

> I think this is more a problem of the way that OO is typically
implemented.
> C++ is particularly bad here: during construction, all calls are
> "nonvirtual", i.e. you can't use virtual functions to "do the right
> thing" during object initialization. Since there's a very common need
> for that, you end up using two-phase object construction: first
> construct the object, then initialize it.

And made much worse by the workings of  initialising reference and const
data.
(And have you ever noticed how poorly const works the iostream library? They
just don't fit together at all.)

> If a language
> makes it easy to package out-of-band data such as error diagnostics into
> results, and where it's likewise easy to disassemble that data on the
> caller side, then it's not necessary to have this. In other words:
> traditional programming languages are missing both tuples that can be
> defined and constructed with minimal syntactic overhead, and they are
> missing pattern matching on tuples.

Very, very true! Other than the lack of closures (and you could only ever
have a restricted version of them in a non-GC language) I find the combined
absence of pattern matching and tuples the greatest lack in C++ (which is
the language I work in 90% of the time, and really does have many advantages
for an important if restricted set of real world programming tasks.)

Thought: you can add restricted closure support to C++ using the Open C++
toolkit - I wonder if it will support pattern matching?

It's other big problem is that the language needs a refactoring browser as
much or more than Java or Smalltalk, but is so hard to parse that no one
seems capable of writing one.

- Jonathan






More information about the erlang-questions mailing list