[erlang-questions] Erlang and Akka

Richard A. O'Keefe <>
Fri Aug 29 00:10:41 CEST 2014


On 29/08/2014, at 2:18 AM, Xiao Jia wrote:
> 
> So what if we have both Erlang(-style) concurrency and C++ performance (for number crunching, ...) in some new language (yet to be developed)?

C++ performance relies on several things.
One of them is the type system.
We know how to get close-to-C performance in a functional
language; Xavier Leroy did an impressive job with OCaml.
It depends on a good type system.

The trick is to extend the type system to send and receive.
This seems like the weakest aspect of Dialyzer: I cannot
say "X is a process id for a process that expects
messages of type Y".

Get the type system right and the rest will follow.

Of course, one of Erlang's strengths has always been that you
don't *have* to use types.

Having said that, I must emphasise once more that
"I am writing in C++" does NOT imply "my code is efficient".
I have known *interpreted* Scheme to run faster than
*compiled* C++.  Memory management is a tricky subject and
manual (delete) or semi-manual (smart pointers) is NOT always
faster.

>  Regardless of community size, reusable libraries and other "human-related" issues commonly faced by any new language, can we say such a new language is better than both Erlang and C++ because it (potentially) beats both in performance and concurrency, respectively?

One of the saddest errors in classical philosophy was the use
of "better" as though it was unequivocal.  Let E be Erlang,
C be C++, and N be the new language.  It is possible that
  N >= E (concurrency)
  N >  E (performance)
  N <  E (readability)
  N <  E (human error rate)
  N >  C (concurrency)
  N >= C (performance)
  N <  C (readability -- unlikely but for the sake of argument)
  N <  C (human error rate -- again unlikely but still)
We would then have to say that N is better than E and C
AND ALSO that N is worse than E and C.






More information about the erlang-questions mailing list