Deprecate finalizers? As done in Java 18

I believe Julia has finalizers (never looked into very carefully). Otherwise just ignore, read as Java trivia.

Java 1 introduced finalizers (and just released Java 18 deprecated them). Are they similiar enough in Julia (and e.g. C#) to also be a mistake there? C# has finalizers, renamed from destructors, their original misleading name, as the feature in C# more like Java, unlike C++'s destructors.

JEP 421: Deprecate Finalization for Removal

https://openjdk.java.net/jeps/421

As I understand it, Julia’s finalizes are much closer to Java’s Cleaners which are what they recommend replacing finalizes with.

1 Like