> This can't be done with just object destructors as ref's and owned ref's are 
> created by compiler magic and we can't make custom destructors for them.

How to deal with that problem is part of the spec, see `.nodestroy`.

> If this example and my thinking are correct, we are doing a lot of work on 
> something that doesn't seem to achieve the goals, unless we can extend some 
> ideas to include this case?

I hope, it will achieve the goals that I claimed, I never claimed to care about 
this list-business, it's a dead-end for performance ever since we got hardware 
caches in the 90ies.

> Reference counting is not able to be turned off as the source code says that 
> would be an "unsafe" option.

Yes, you keep making this claim. It doesn't suddenly become true though. A 
dangling ref detector can always be turned off, just like I can decide to 
**not** run my code through Valgrind.
    
    
    template own[T](x: T): owned T = # complement to `unown`
      var rslt: owned T
      cast[ptr T](rslt.unsafeAddr)[] = x
      rslt
    
    
    Run

Well at this point you're on your own and way beyond any proposal for the new 
runtime. You cannot get ownership back via casting.

Reply via email to