I really like this paper which has a clear and sim...
# linking-together
c
I really like this paper which has a clear and simple reference counting system for a functional language, which ends up being surprisingly performant. https://microsoft.com/en-us/research/uploads/prod/2020/11/perceus-tr-v1.pdf The key point is that it is fairly easy for the programmer to anticipate when memory will be freed and then immediately refused, allowing for code that effectively mutates memory in place. For example if you say;
Copy code
X = f(10)
Y = f(X)
Then you know (assuming it fits) that Y will take the place of X in memory.
👍 1
❤️ 3
k
Since they can make this guarantee, they can largely use immutable references without giving up performance. And it's clear to the programmer where any cycles could be: in the mutable references. Very cool paper!
d
This is the memory management strategy I've chosen for Curv, but I didn't think it was new. I thought I was stealing the idea from APL. Nice paper, it lays out the ideas very clearly. https://aplwiki.com/wiki/Performance#Reference_counting_and_data_reuse
So maybe the PLD community is balkanized. APL has been refcounted since the very beginning in the mid 1960s. APL implementors have been sweating the details on how to make a ref counted functional language fast for 55 years.