Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET language for Concurrent programming

This may be a question that others have seen, but I am trying to find a language designed for (or with language support for) concurrent programming that can run on the .net platform.

I have been doing side development in erlang to get a feel for the language and have loved how easy it is to get a stable concurrent or even distributed system up. It led me to scala which also had a nice system using actors, however scala.net does not seem to have this functionality currently (Granted this is a concurrent system vs a distributed system). The two .net languages I was looking at are Axum and F#.

Are these the only choices I have? Are there others? And, if they are the only choices, what are the advantages/disadvantages of each?

like image 923
Mike Avatar asked Sep 22 '10 23:09

Mike


People also ask

Which language is best for concurrent programming?

Java, C# and C++ are three well-known languages with good support for concurrency.

What is concurrent programming in C#?

End-user applications use concurrency to respond to user input while writing to a database. Server applications use concurrency to respond to a second request while finishing the first request. You need concurrency any time you need an application to do one thing while it's working on something else.

Does C# support parallel programming?

With TPL we can implement Parallel Programming in C# . NET very easy. Async and Await keywords were introduced in C# 5.0 by Microsoft. When you use the “Async” keyword, you can write code the same way you wrote synchronous code.

Which languages do not support concurrent programming?

java, scala, python, none of the above​


1 Answers

Axum is a research project. A real research project, where only ideas from it will end up in products. (Unlike F#, which was productized as a whole.) I'm not even sure the license allows using it to develop production applications.

F# is a fine choice.

Clojure also runs on the CLI, and is a good choice, too.

The CLI port of Scala is currently in the process of being resurrected (with officiall funding from Microsoft, actually), and Scala's Actor libraries (both the built-in one, as well as Akka) are pretty good.

Regarding @wmeyer's comment above: Scala itself doesn't have any provisions for distributed programming. (Neither does Clojure.) Both generally rely on the myriad of Java frameworks that exist for that purpose, such as Terracotta. However, Akka does have Remote Actors for distributed programming, and Akka is largely API-compatible with the built-in Scala Actor library, which allows for a smooth transition.

Erlang would be kind of cool. Kresten Krab Thorup is currently working on Erjang, an Erlang implementation on the JVM, and he has some pretty impressive results: running on HotSpot, Erjang scales comparably to BEAM, sometimes even better. For example, in the (in)famous process-ring benchmark with 10000 processes, Erjang starts up only minimally slower than BEAM, but when you repeat the run several times and the JIT kicks in, it overtakes BEAM after about 3 runs (and curiously, BEAM starts slowing down after 4 runs).

I'm pretty sure you could build an "#rlang" on the DLR and the TPL that performs equally well.

like image 54
Jörg W Mittag Avatar answered Sep 23 '22 05:09

Jörg W Mittag