Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I love Nim's syntax, but is there a specific reason why e.g. the SFML binding cannot imitate C++ RAII approach of handling resources? There is .close everywhere.


Destruction used to be nondeterministic in Nim. Right now though, if you use the ARC/ORC instead of the default GC (ORC will be made the default GC soon) you can have RAII for reference types (RAII is available for value types by default, just write a destructor for your type).

SFML binding probably will be updated to use RAII when ORC is made the default GC.

See this document for more info on Nim's destructors: https://nim-lang.org/docs/destructors.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: