Can a non-Interpretation language have a garbage collector?

Is it possible for a language without interpretation to have a garbage collector. Interpreted languages ​​have an interpreter that runs the Program line by line, so the interpreter can also provide GC runtime. But is it possible to have a garbage collector for any other language without creating a GC in your code?

+5
source share
8 answers

Yes.

C ++ with the implementation of a smart pointer will collect garbage, since the count of references to smart pointers is zero.

You have a garbage collection. You yourself did not create it.

0
source

, , . /, .

+11

, .NET( IL-#, VB.NET, M++ ..) ( NGEN) - .

, Java.

+6
+3

Haskell , .

+3

The new C ++ 0x includes features that facilitate the implementation of the garbage collection. See here for an interview .

+2
source

Objective-C 2 now has garbage collection, and there are garbage collection libraries available also for C ++.

I think this is possible if there is a language that allows you to scan objects so that you can traverse the tree of objects.

0
source

All Articles