Open mratsim opened 1 year ago
Finalizer is just Destructor?, or I am missing somethin' Stdlib should add destructors.
And if it's not anymore, documentation on finalizers is missing.
We map finalizers to destructors. Which is not entirely correct but it works well enough in practice. However, one can argue that we should deprecate finalizers for this reason.
However, one can argue that we should deprecate finalizers for this reason.
+1 - ie finalizers have a very odd implementation where instantiating a type once with a finalizer changes all instances - even those that where created before or are created without the finalizer parameter .. same as shallowCopy, get rid of it
Not a RFC per se but I don't see finalizers appearing in the roadmap (https://github.com/nim-lang/RFCs/issues/503, https://forum.nim-lang.org/t/9777) or any Nim v2 discussion (https://forum.nim-lang.org/t/9132)\
They don't even appear in the manual https://nim-lang.org/docs/manual.html or lifetime tracking hook docs https://nim-lang.org/docs/destructors.html#lifetimeminustracking-hooks.
With Nim v2 with have an opportunity to replace the finalizer syntax with
=destroy
which iirc was always the plan. And if it's not anymore, documentation on finalizers is missing.So what's the plan here? Is that in roadmap 2023?