[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Are symbols garbage collected?
From: |
Christopher Allan Webber |
Subject: |
Re: Are symbols garbage collected? |
Date: |
Mon, 23 Oct 2017 14:35:11 -0500 |
User-agent: |
mu4e 0.9.18; emacs 25.3.1 |
Marko Rauhamaa writes:
> Christopher Allan Webber <address@hidden>:
>
>> I thought they weren't but now I'm not really sure where I got that
>> idea from. Does anyone know for sure?
>
> I don't think the language spec says anything about any particular
> object or object type being garbage collected. Symbols are first-class
> objects and undergo the same treatment as any other object.
Yes, though they are intern'ed, and symbols are not always garbage
collected. I know in Ruby at one point they were not, I heard today
they aren't in Erlang either, and even until apparently recently they
weren't GC'ed in MIT Scheme I think:
https://www.gnu.org/software/mit-scheme/release.html
"Symbols can now be garbage-collected." in 9.1 even.. that came out in
2011!
Anyway it looks like Guile does indeed garbage collect symbols. I have
no idea how I got the impression that it did not, but it looks like it
isn't unusual for symbols to not be GC'ed in a number of languages.