Re:Programming R at native speed using Haskell
by jzwinck on Wednesday September 09, 2015 @06:19AM
(#10190630)
How does garbage collection work? Does this version improve on the R I know from a year ago, which had a reference counting system with only three values: 0, 1, and 2+?
[ Parent
| on HN ]
Re:Programming R at native speed using Haskell
by rfergie on Wednesday September 09, 2015 @06:23AM
(#10190633)
https://tweag.github.io/HaskellR/docs/managing-memory.html
https://tweag.github.io/HaskellR/docs/memory-allocation.html
Both these links have more information on this.
As far as I can tell (and most of this is way over my head) the native R garbage collection is used
Re:Programming R at native speed using Haskell
by mboes on Wednesday September 09, 2015 @07:49AM
(#10190848)
Yes - the R GC manages R objects allocated by the R interpreter, and conversely the Haskell GC manages Haskell objects allocated by the Haskell runtime.
Re:Programming R at native speed using Haskell
by hadley on Wednesday September 09, 2015 @07:34AM
(#10190802)
You're confusing reference counting (which is used primarily for R's copy-on-modify strategy) and its generational garbage collector.
Re:Programming R at native speed using Haskell
by jzwinck on Wednesday September 09, 2015 @10:12AM
(#10191542)
In that case, does HaskellR interfere with copy-on-modify in R, for example does it increment the reference count of R objects, then try to decrement them (which R doesn't or didn't really support), leaving those objects appearing to be multiply-referenced, and therefore forcing unnecessary copies as we see in plain R?