<p>What libraries exist for other programming languages to provide an Erlang-style concurrency model (processes, mailboxes, pattern-matching receive, etc.)?</p>

<p>Note: I am specifically interested in things that are intended to be similar to Erlang, not just any threading or queueing library.</p>

[{'answer_id': 22197, 'author': 'Frank Krueger', 'author_id': 338, 'author_profile': 'https://Stackoverflow.com/users/338', 'pm_score': 3, 'selected': False, 'text': '<p>Microsoft <a href="http://msdn.microsoft.com/en-us/library/bb648752.aspx" rel="noreferrer">Concurrency and Coordination Runtime</a> for .NET.</p>\n\n<blockquote>\n  <p>The CCR is appropriate for an\n  application model that separates\n  components into pieces that can\n  interact only through messages.\n  Components in this model need means to\n  coordinate between messages, deal with\n  complex failure scenarios, and\n  effectively deal with asynchronous\n  programming.</p>\n</blockquote>\n'}, {'answer_id': 22226, 'author': 'Mo.', 'author_id': 1870, 'author_profile': 'https://Stackoverflow.com/users/1870', 'pm_score': 3, 'selected': False, 'text': '<p>Scala supports actors. But I would not call scala intentionally similar to Erlang.</p>\n\n<p>Nonetheless scala is absolutely worth taking a look!</p>\n'}, {'answer_id': 22231, 'author': 'Mo.', 'author_id': 1870, 'author_profile': 'https://Stackoverflow.com/users/1870', 'pm_score': 3, 'selected': False, 'text': '<p>Also <a href="http://www.malhar.net/sriram/kilim/" rel="noreferrer">kilim</a> is a library for java, that brings erlang style message passing/actors to the Java language. </p>\n'}, {'answer_id': 22285, 'author': 'jcsalterego', 'author_id': 1416, 'author_profile': 'https://Stackoverflow.com/users/1416', 'pm_score': 4, 'selected': True, 'text': '<p>Message Passing Interface (MPI) (<a href="http://www-unix.mcs.anl.gov/mpi/" rel="noreferrer">http://www-unix.mcs.anl.gov/mpi/</a>) is a highly scalable and robust library for parallel programming, geared original towards C but now available in several flavors <a href="http://en.wikipedia.org/wiki/Message_Passing_Interface#Implementations" rel="noreferrer">http://en.wikipedia.org/wiki/Message_Passing_Interface#Implementations</a>.  While the library doesn\'t introduce new syntax, it provides a communication protocol to orchestrate the sharing of data between routines which are parallelizable.</p>\n\n<p>Traditionally, it is used in large cluster computing rather than on a single system for concurrency, although multi-core systems can certainly take advantage of this library.</p>\n\n<p>Another interesting solution to the problem of parallel programming is OpenMP, which is an attempt to provide a portable extension on various platforms to provide hints to the compiler about what sections of code are easily parallelizable.</p>\n\n<p>For example (<a href="http://en.wikipedia.org/wiki/OpenMP#Work-sharing_constructs" rel="noreferrer">http://en.wikipedia.org/wiki/OpenMP#Work-sharing_constructs</a>):</p>\n\n<pre><code>#define N 100000\nint main(int argc, char *argv[])\n{\n  int i, a[N];\n  #pragma omp parallel for\n  for (i=0;i&lt;N;i++) \n     a[i]= 2*i;\n  return 0;\n}\n</code></pre>\n\n<p>There are advantages and disadvantages to both, of course, but the former has proven to be extremely successful in academia and other heavy scientific computing applications. YMMV.</p>\n'}, {'answer_id': 22451, 'author': 'cnu', 'author_id': 1448, 'author_profile': 'https://Stackoverflow.com/users/1448', 'pm_score': 2, 'selected': False, 'text': '<p>For python you can try using <a href="http://pyprocessing.berlios.de/" rel="nofollow noreferrer">processing module</a>.</p>\n'}, {'answer_id': 22456, 'author': 'denis phillips', 'author_id': 748, 'author_profile': 'https://Stackoverflow.com/users/748', 'pm_score': 3, 'selected': False, 'text': '<p>Mike Rettig created a .NET library called <a href="http://code.google.com/p/retlang/" rel="noreferrer">Retlang</a> and a Java port called Jetlang that is inspired by Erlang\'s concurrency model.</p>\n'}, {'answer_id': 54452, 'author': 'argv0', 'author_id': 5595, 'author_profile': 'https://Stackoverflow.com/users/5595', 'pm_score': 4, 'selected': False, 'text': '<p><a href="http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/" rel="noreferrer">Ulf Wiger</a> had a great post recently on this topic - here are the properties he defines as required before you can call something "Erlang Style Concurrency":</p>\n\n<ul>\n<li>Fast process creation/destruction</li>\n<li>Ability to support >> 10 000 concurrent processes with largely unchanged characteristics.</li>\n<li>Fast asynchronous message passing.</li>\n<li>Copying message-passing semantics (share-nothing concurrency).</li>\n<li>Process monitoring.</li>\n<li>Selective message reception.</li>\n</ul>\n\n<p>Number 2 above is the hardest to support in VMs and language implementations that weren\'t initially designed for concurrency.  This is not to knock Erlang-ish concurrency implementations in other languages, but a lot of Erlang\'s value comes from being able to create <i>millions</i> of processes, which is pretty damn hard if the process abstraction has a 1-1 relationship with an OS-level thread or process.   Ulf has a lot more on this in the link above.</p>\n'}, {'answer_id': 274310, 'author': 'Doug Currie', 'author_id': 33252, 'author_profile': 'https://Stackoverflow.com/users/33252', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://code.google.com/p/termite/" rel="nofollow noreferrer">Termite</a> for Gambit Scheme.</p>\n'}, {'answer_id': 502340, 'author': 'Volker Stolz', 'author_id': 60462, 'author_profile': 'https://Stackoverflow.com/users/60462', 'pm_score': 2, 'selected': False, 'text': '<p>Warning: shameless plug!</p>\n\n<p>I developed a library for this kind of message passing in Haskell:\n<a href="http://www.iist.unu.edu/~vs/haskell/dhs/" rel="nofollow noreferrer">Erlang-style Distributed Haskell</a>.</p>\n\n<p>Volker</p>\n'}, {'answer_id': 971146, 'author': 'luccastera', 'author_id': 76372, 'author_profile': 'https://Stackoverflow.com/users/76372', 'pm_score': 2, 'selected': False, 'text': '<p>If you are using Ruby, take a look at <a href="http://revactor.org/" rel="nofollow noreferrer">Revactor</a>.</p>\n<p>Revactor is an Actor model implementation for Ruby 1.9 built on top of the Rev high performance event library. Revactor is primarily designed for writing Erlang-like network services and tools.</p>\n<p>Take a look at this code sample:</p>\n<pre><code>  myactor = Actor.spawn do\n    Actor.receive do |filter|\n      filter.when(:dog) { puts &quot;I got a dog!&quot; }\n    end\n  end\n</code></pre>\n<p>Revactor only runs on Ruby 1.9. I believe the author of the library has discontinued maintaining it but the documentation on their site is very good.</p>\n<p>You might also want to take a look at Reia: a ruby-like scripting language built on top of the Erlang VM. Reia is the new project of the creator of Revactor: Tony Arcieri.</p>\n'}, {'answer_id': 971197, 'author': 'Hans Van Slooten', 'author_id': 28585, 'author_profile': 'https://Stackoverflow.com/users/28585', 'pm_score': 2, 'selected': False, 'text': '<p>Microsoft\'s Not-Production-Ready Answer to Erlang: <a href="http://msdn.microsoft.com/en-us/devlabs/dd795202.aspx" rel="nofollow noreferrer">Microsoft Axum</a></p>\n'}, {'answer_id': 1605757, 'author': 'ygrek', 'author_id': 118799, 'author_profile': 'https://Stackoverflow.com/users/118799', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://jocaml.inria.fr/" rel="nofollow noreferrer">JoCaml</a> extends OCaml with join calculus for concurrent and distributed programming.</p>\n'}, {'answer_id': 7693016, 'author': 'pondermatic', 'author_id': 43836, 'author_profile': 'https://Stackoverflow.com/users/43836', 'pm_score': 2, 'selected': False, 'text': '<p>Akka (<a href="http://akka.io/" rel="nofollow">http://akka.io</a>) is heavily influenced by erlangs OTP. It has built on scala\'s actors and is great for concurrency on the JVM.</p>\n'}]
['https://Stackoverflow.com/questions/22187', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1175/']