Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 744
J D Avatar asked Nov 10 '08 13:11

J D


People also ask

Which programming languages use garbage collection?

Garbage collection (GC) is a memory recovery feature built into programming languages such as C# and Java.

What is concurrent garbage collector?

Concurrent garbage collection enables interactive applications to be more responsive by minimizing pauses for a collection. Managed threads can continue to run most of the time while the concurrent garbage collection thread is running. This design results in shorter pauses while a garbage collection is occurring.

Do all languages have garbage collectors?

Garbage collection is the process in which programs try to free up memory space that is no longer used by objects. Garbage collection is implemented differently for every language. Most high-level programming languages have some sort of garbage collection built in.

What languages do not have garbage collection?

Primitive programming languages like C and C++ do not have their garbage collection instead expect the developer to not only allocate the object but also deallocate it explicitly. Hence we see the functions like "malloc" and "free".


2 Answers

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.

like image 108
svenningsson Avatar answered Sep 18 '22 16:09

svenningsson


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

like image 21
Claymore Avatar answered Sep 20 '22 16:09

Claymore