it’s worth noting that many who have tried using deinit semantics for resource management have found it counterproductive in the end, and i’ve seen some movement (in SwiftNIO, NIOHTTP2, etc.) away from that pattern and towards explicit lifetime management.
i’ve said this before but i’ll link it since it’s relevant:
electricity is expensive, but it’s nowhere near as expensive as paying human beings to spend time engineering ways to shave a small percentage off an electricity bill.