First I'll say I just started learning nim and used it for part of a small project and it was a joy to program in, a lot shorter and simpler to do the same tasks as it would be in c or c++ and still compiles to small and fast native code. My program was opening a lot of network connections, and I read in https://nim-lang.org/docs/destructors.html > As a nice bonus, files and sockets and the like will not require manual close calls anymore.
Now I understand it says pretty clear 'will not' as it's a future plan, but it seemed the document was describing things as they work in 1.6.4 and I wanted to not worry about closing everything so I interpreted it how I wished to be true :) until I saw that the sockets weren't actually closing unless I closed them. I looked at the std lib in devel branch and it also doesn't have it either. Of course we can implement our own socket type with =destroy method that closes it, but is there a reason it's not added to the socket and file types in the std library? It seems like a small change that can't break any existing code? and would be quite a nice bonus to not worry that socket or file descriptors can leak
The underlying issue IMHO is whether or not we accept that =destroy hook can raise.
Currently, I've had cases where letting it happen made code harder to debug because =destroy can be called in the finally clause of a try block overriding (and thus hiding the first raised exception).
In C++, it is considered bad practice to have uncaught exception in destructor, and IMHO the same apply to Nim which typically makes destructor for files, sockets etc. More difficult to handle (because closing proc can fail and thus raise exception)