C is fastest

Christopher Browne cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Wed Oct 14 19:57:12 UTC 2009


On Wed, Oct 14, 2009 at 3:44 PM, Lennart Sorensen
<lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org> wrote:
> I do believe that if we actually want to take advantage of our now common
> 4 and 8 way machines, we need languages that are functional not OO so
> that the language and compiler can auto generate multithreaded code
> to take advantage of modern machines.  Most programmers can't write
> multithreaded code that works.  Preferably they shouldn't have to either,
> but I do believe they have to give up OO to get there.  Perhaps OO
> doesn't have to completely go, but certainly I don't believe java and
> C++ stand a chance here.  Microsoft may be able to do something with C#
> or more likely F# (which is a nice looking language, too bad I don't
> care to write code in Visual Studio on windows).

With this I agree.

FYI, F# is a dialect of ML which is mostly like OCAML.  (Presumably
except for some parts that aren't like OCAML; dunno what...)

It should be pointed out that OO has a propensity for being
incompatible with thread-safety, and that's an increasing problem
these days.  OO tends to bind state together with data structures, and
requires having strict interfaces to those objects, which, with the
greater concurrency we're seeing on many-core CPUs, leads to a lot
more locking/blocking.

The language that seems to have gone the furthest in the opposite
direction is Erlang.

They basically took Prolog, dropped out backtracking, which means
you're left with deterministic functional (e.g. - "one path") code,
which has the massive benefit that practically all your code becomes
re-entrant, and may be invoked many times in parallel.

Unfortunately, they took a Prolog-ish syntax, which tends to confuse people.

It's not clear whether ML can be readily parallelized in congruent fashion.

-- 
http://linuxfinances.info/info/linuxdistributions.html
Marie von Ebner-Eschenbach  - "Even a stopped clock is right twice a
day." - http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list