J D
J D

Reputation: 48707

Functional languages with concurrent garbage collectors?

Microsoft's new F# programming language provides the powerful combination of functional programming (first-class lexical closures and tail calls) with an efficient concurrent garbage collector that makes it easy to leverage multicores.

OCaml, Haskell, Erlang and all free Lisp and Scheme implementations that I know of do not have concurrent GCs. Scala and Clojure have a concurrent GC but no tail calls.

So there appear to be no open source programming languages that combine these features. Is that correct?

Upvotes: 5

Views: 1202

Answers (5)

svenningsson
svenningsson

Reputation: 4049

Erlang has a shared nothing model where each process has it's own garbage collector. Whether you consider that to be no concurrency or not it's up to you. But it sure scales very well as the number of processes goes up.

Upvotes: 8

Craig Stuntz
Craig Stuntz

Reputation: 126587

Scala has some tail recursion optimization. But get SISC scheme for the full thing.

Upvotes: 4

Lou Franco
Lou Franco

Reputation: 89242

Java is supposedly adding tail calls. When that happens, clojure will get them. In the meantime, you can get them manually with the loop/recur mechanism.

Upvotes: 0

Stephan Leclercq
Stephan Leclercq

Reputation: 893

Not really an answer to your question, but to my best knowledge, F# uses the standard .NET garbage collector, which is not concurrent; all threads are stopped during GC.

Edit : my mistake, there is a concurrent GC in multiprocessor mode.

Upvotes: 0

Claymore
Claymore

Reputation: 319

Latest version of GHC supports parallel GC. See the release notes.

Upvotes: 5

Related Questions