Was stuck the past week(s) in my #lisp implementation in #zig on #closures, 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 #garbagecollector for this.

I rather choose to use #ARC (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.

I’ve written a fairly big blogpost about it too, including not only the whole explanation how it works but also alternatives I’ve considered. Check it out if you’re interested!

Now I only need to translate it over to zig, but hopefully that dosnt take so long x3

#coding #programming #software #oss #foss #ossdev #fossdev #lisp #zig #rust #softwaredevelopment #pldev #programminglanguages #referencecounting #rc #arc