Meyer, OO and concurrency

Ulf Wiger <>
Wed Jul 13 23:36:23 CEST 2005


Den 2005-07-13 20:59:00 skrev todd <>:

> Ulf Wiger wrote:
>
>> You accounted for the views of others that C++ was a safer
>> and more all-round choice than Erlang.
>
> You've got to be kidding. I said just the opposite several times.

???

On 2005-07-13 17:23:38 you wrote:

> I am just telling you what the perception is from a real live person who  
> has had these conversations within a real live telecom company. The fact  
> that things like rerouting algorithms were not implemented in erlang was  
> seen as a weakness. The fact that C++ could be used every level was seen  
> as a strength.

I don't think my description of what you wrote is terribly far-fetched.


> The contention that you can't do concurrency on an OO langauge like
> C++ is just plain wrong.

No one has contended that.
It's been contended, however, that threads programming with shared
state is very difficult and error-prone.

> That you can do it better in other languages like erlang is unquestioned,
> assuming a suitable definition of better. If better involves low latency  
> then erlang is not better.

A very ambitious benchmark of database management systems for
embedded applications was once done at Ericsson. For various
reasons, I doubt that it will be published outside. Mnesia was
one of the DBMSes tested, and it performed as well as the best
third party product (Clustra) in terms of TPS and scalability
(on which it was only beaten by two DBMSes developed in C++
in-house.) As an afterthought, latency was derived from the
test results. By this measure, mnesia was the winner by a
wide margin. It was contended by some that they would have
done better if they'd known that latency was to be measured,
but just about everyone was quite surprised that mnesia
did as well as it did on latency.


> Partitioning a large embedded system into two different language domains
> is very unnatractive to many many people. Having been the one to try and
> sell this,  I know. Call that the myopic application of the hammer-nail  
> pattern, if it pleases you.


I have plenty of experience building systems that use several different
languages. There are several problems with this, I agree. My personal
opinion is that the difficulties are often exaggerated, and that the
single-language approach is often highly over-estimated.


> Can I do concurrency in C++ well enough to keep a single language for
> the lowest part of the system to the highest? Yes.

Good for you. I've seen many examples of this approach failing
miserably. My own opinion of C++ is that it's a disaster in large
projects, but can be successful in a small project with very
knowledgeable C++ programmers, and at least a few brilliant ones.
Even then, I've often thought (especially looking back) that the
problems with taking the C++ approach have been radically under-
estimated, and that using Erlang would have been a much better
option -- even if it meant having to teach it to all developers
 from scratch.


>  > This is a group of users that has never been targeted by Erlang.
>
> That's the embedded world.

That's _one type_ of embedded systems. I'm pretty familiar with it,
even though I've not programmed in such an environment myself.
Telco systems tend to have subsystems with these characteristics,
but the telco systems themselves are also embedded systems.

There are also embedded systems that require hard real-time
characteristics, and these are expressly not targeted by Erlang.
But accepting the requirement for liveliness guarantees can
buy endless difficulties if the system doesn't require it,
and the concurrency patterns are tricky enough.


> It has the ultimate mix of high performance code, mixed with scaling
> issues, mixed with low performance code. To ask people to partition
> the system using a completely new language they have no experience
> with is not attractive enough.

> Everything you need to do in erlang you also have to be able to do on
> the C++ side as well.

Obviously, I can't comment on the systems you've worked on, but
having worked with multi-language systems since... well, 1989,
I'd have to say that with a good partitioning, this is absolutely
not the case.


> So, I know I am wasting my time saying all this,

It's not a waste of time, as long as the discussion stays
professional. Eventually, one may have to agree to disagree
and wrap things up, though. (:

/Uffe




More information about the erlang-questions mailing list