logoalt Hacker News

masklinntoday at 4:59 AM0 repliesview on HN

RAII has complications in GC’d, fuzzy ownership langages, it becomes much less ergonomic there because now passing an RAII object as parameter to a function causes that function to clean it up, so you need additional mechanisms to bypass this. Same if you just poke an RAII object inside a collection.

Traditionally langages with simpler runtimes simply used destructors for this, refcounting made it deterministic (modulo the old reference leak), but more advanced garbage collection schemes made that stop working.