Full threadadgjlsfhk1·Julia solves this pretty well by having a gc_preserve macro that tells the compiler that an object has hidden references within the scope.View on HN