it's mesmerizing that the fantastic ergonomics of RAII have not propagated to other languages.
It's way easier to use, much clear, less typing, more predictable runtime behavior.
RAII... terrible name, great concept!
It only works for stack allocations or when using reference counting, which isn't the ultimate performance of GC algorithms.
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.