Well, well...

Robert Fraser fraserogfthenight at gmail.com
Thu Aug 2 15:31:03 PDT 2007


> I think this is true.  Concurrency designed around message passing is 
> far more scalable than concurrency involving shared state, for example, 
> and message passing is really nothing more than a mechanism to increase 
> modularity.  In fact, I've pretty much decided recently that concurrent 
> programming is really slowly working towards a pure message-passing 
> design similar to Erlang, and that library solutions in traditional 
> imperative languages are simply attempts to extend the useful life of 
> existing code (futures, etc).

SO how about a thread-pool based message-passing actor model in Tango :-)?

> As an aside, one interesting aspect of Erlang is that it turns code 
> reliability on its head to a degree by simply aborting the process if an 
> exception occurs.  This seems far preferable to the manual exception 
> recovery typically done in C++, Java, and D, which reduces code clarity 
> and can be difficult to get right.  Concepts like DBC, however, provide 
> a quite useful degree of boundary checking, and seem applicable 
> regardless of the degree of modularity introduced.

Depends what type of exception. The concept of "exception" is being used to represent both bugs/unexpected state in the code (which should be handled explicitly by the coder) and unexpected circumstances in resources. Should your web browser halt if it can't connect to a server? Should your word processor halt if it tries to save to a read-only file? These are the situations where exceptions are far clearer than C's way of dealing with error codes, etc.




More information about the Digitalmars-d mailing list