Hacker News new | ask | show | jobs
by tene 972 days ago
Lifetime analysis matters a lot for way more than just garbage collection.

File handles, iterators, mutex guards, database transaction handles, session types, scoped threads, anything where ordering or mutual exclusivity matters.

1 comments

I don't know about all of those, but Python's context managers and built in constructs handle most of those, I think?
Only in the most basic cases. If your handle has to be passed into another function or outlive the current scope of your function, the guardrails end.