3 ms·
Yes, really only D and Rust, nothing else. If you think other language X supports RAII, you don't really understand it. It's not really compatible with obligat
by ncmncm 6y ago
Yes, really only D and Rust, nothing else.
If you think other language X supports RAII, you don't really understand it. It's not really compatible with obligate-GC. Finalizers, in particular, are not it.
The thing about destructors is that reclaiming memory is only their most trivial use. In C++, as in D and Rust, and Haskell, too, catching errors is the type system's most trivial use. It does the heavy lifting.
If your program isn't putting the type system to work, you're toiling away with a screwdriver while people around you are using impact drivers and forklifts.
- int_19h 6y agoIt's perfectly compatible with GC. GC manages memory. RAII manages object lifetime. C++/CLI, for example, has full-fledged C++ RAII implemented on top of GC memory management.
- ncmncm 6y agoFine, but having managed lifetime, it also manages memory, leaving nothing worthwhile for GC to do.