Remix.run Logo
smasher164 2 hours ago

Is there a reason you didn't go with something like Boehm for a library gc, instead of writing your reference counting implementation?

oraziorillo 23 minutes ago | parent | next [-]

Mainly did it for learning, as dgellow correctly presumed, but also there’s something intrinsically beautiful in writing code with zero dependencies

dgellow 2 hours ago | parent | prev [-]

Learning, I presume?

toxik an hour ago | parent [-]

Also refcounting is not a very difficult thing to implement

smasher164 an hour ago | parent [-]

I guess I interpreted this part of their README as implying that the author found RC too fragile

> Reference counting buys correctness and composability, but at a cost.

> Disadvantage #1: you must balance every reference. Each value_create, value_retain, and each operation's implicit retain of its operands has to be matched by a value_release. Forget one and you leak; do one too many and you free memory that is still in use. The training examples in examples/ are verbose precisely because they are scrupulous about this in their error paths; that verbosity is the price of leak-free C.