Comment by pseudony

Comment by pseudony 13 hours ago

2 replies

Ownership models like Rust require a grester ability for holistic refactoring, otherwise a change in one place causes a lifetime issue elsewhere. This is actually exactly what LLM's are doing the worst at.

Beyond that, a Python with something like lifetimes implies doing away with garbage-collection - there really isn't any need for lifetimes otherwise.

What you are suggesting has nothing to do with Python and completely misses the point of why python became so widely used.

The more general point is that garbage collection is very appealing from a usability standpoint and it removes a whole class of errors. People who don't see that value should look again at the rise of Java vs c/c++. Businesses largely aren't paying for "beautiful", exacting memory management, but for programs which work and hopefully can handle more business concerns with the same development budget.

vlovich123 6 hours ago

Rust lifetimes are generally fairly local and don’t impact refactoring too much unless you fundamentally change the ownership structure.

Also a reminder that Rc, Arc, and Box are garbage collection. Indeed rust is a garbage collected language unless you drop to unsafe. It’s best to clarify with tracing GC which is what I think you meant.

pjmlp 13 hours ago

While I go into another direction in a sibling comment, lifetimes does not imply not needing garbage collection.

On the contrary, having both allows the productivity of automatic resource management, while providing the necessary tooling to squeeze the ultimate performance when needed.

No need to worry about data structures not friendly to affine/linear types, Pin and Phantom types and so forth.

It is no accident that while Rust has been successful bringing modern lifetime type systems into mainstream, almost everyone else is researching how to combine linear/affine/effects/dependent types with classical automatic resource management approaches.