Mai :v_trans:<p>Was stuck the past week(s) in my <a href="https://soc.saiyajin.space/tags/lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>lisp</span></a> implementation in <a href="https://soc.saiyajin.space/tags/zig" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>zig</span></a> on <a href="https://soc.saiyajin.space/tags/closures" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>closures</span></a>, as they provide an real challange with their capturing properties. Espc bc I didn't wanted to resort to using things like arbitary "rules" to restrict the language only for closure to work, or already implementing a tracing <a href="https://soc.saiyajin.space/tags/garbagecollector" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>garbagecollector</span></a> for this.</p><p>I rather choose to use <a href="https://soc.saiyajin.space/tags/ARC" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ARC</span></a> (Atomically Reference counting) for this, which comes with a few problems. And as I found nobody that has solved this problem, I've come up with a solution to it myself: 'Switchable references with strongchain elemination'. A bit bulky name, and the technique is still in it's beginning, but when implemented in rust the compiler dosnt complain and valgrind dosn't detects any leaks.</p><p>I've written a fairly big <a href="https://blog.lapyst.dev/posts/11-rollinglisp-001---of-closures-mutability-and-switchable-references" rel="nofollow noopener noreferrer" target="_blank">blogpost about it</a> too, including not only the whole explanation how it works but also alternatives I've considered. Check it out if you're interested!</p><p>Now I only need to translate it over to zig, but hopefully that dosnt take so long x3</p><p><a href="https://soc.saiyajin.space/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a> <a href="https://soc.saiyajin.space/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://soc.saiyajin.space/tags/software" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>software</span></a> <a href="https://soc.saiyajin.space/tags/oss" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>oss</span></a> <a href="https://soc.saiyajin.space/tags/foss" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>foss</span></a> <a href="https://soc.saiyajin.space/tags/ossdev" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ossdev</span></a> <a href="https://soc.saiyajin.space/tags/fossdev" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>fossdev</span></a> <a href="https://soc.saiyajin.space/tags/lisp" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>lisp</span></a> <a href="https://soc.saiyajin.space/tags/zig" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>zig</span></a> <a href="https://soc.saiyajin.space/tags/rust" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rust</span></a> <a href="https://soc.saiyajin.space/tags/softwaredevelopment" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>softwaredevelopment</span></a> <a href="https://soc.saiyajin.space/tags/pldev" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>pldev</span></a> <a href="https://soc.saiyajin.space/tags/programminglanguages" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programminglanguages</span></a> <a href="https://soc.saiyajin.space/tags/referencecounting" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>referencecounting</span></a> <a href="https://soc.saiyajin.space/tags/rc" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>rc</span></a> <a href="https://soc.saiyajin.space/tags/arc" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>arc</span></a></p>