←back to thread

110 points b-man | 3 comments | | HN request time: 0.546s | source
Show context
BlimpSpike ◴[] No.44539960[source]
Kindof unrelated to the article, but I was recently wondering if it would be possible to detect and deny pointer cycles in a language in an efficient way, so that you could then use simple reference counting instead of full-blown garbage collection.

It probably wouldn't be usable for a general-purpose programming language, but for a special-purpose scripting language I could see it making the language implementation easier.

replies(7): >>44539978 #>>44540061 #>>44540517 #>>44540551 #>>44541083 #>>44541588 #>>44541966 #
andreamonaco ◴[] No.44540517[source]
Hello, I'm writing an implementation of the Common Lisp language that uses an enhanced reference counting algorithm (that I've taken from literature) that detects and handles cycles. Performance seems okay, though I still haven't tried large programs.

https://savannah.nongnu.org/p/alisp

replies(1): >>44541263 #
1. zozbot234 ◴[] No.44541263[source]
A somewhat different approach was recently proposed here: https://news.ycombinator.com/item?id=44319427 but it seems to have non-trivial overhead. (Still very much worthwhile, given the potential advantages of deterministic cycle collection.) The paper you reference is quite a bit older so it would of course be interesting to do a proper comparison.
replies(2): >>44541854 #>>44542035 #
2. andreamonaco ◴[] No.44541854[source]
I'll look at that. About performance: people in practice have always favored GC, so I think there's a lot to be discovered in optimization of reference counting algorithms, including concurrent traversal (which is easier because each node has local info in the form of refcounts and flags) and maybe detection of problematic worse-case graphs
3. Findecanor ◴[] No.44542035[source]
The talk for this paper came up on YouTube just the other day: https://www.youtube.com/watch?v=GwXjydSQjD8