Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One issue is that with GC, you lose prompt finalization of resources. A lot of code is written with this assumption in mind (e.g., file buffers are flushed if the last reference to the file is dropped—which is arguable incorrect due to the lack of error checking). And the borrow checker is the only thing that keeps everything from being mutable in place in Rust today. Having GC would open the possibility for alternatives to the borrow checker without compromising memory safety, but even Pony-style reference capabilities probably won't lead to a language where abstractions compose much more easily than in Rust today.

Maybe a language with a similar syntax, traits, monomorphization, and macros would still be interesting to many people? Would people prefer traits and macros over ad-hoc polymorphism (in the style of C++, which could subsume the macro use cases, too)?



An issue only in some GC languages that don't provide the constructors for deterministic resource handling.

Unfortunately people keep placing all GC languages on the same basket.

And before anyone mentions that it is easy to forget, well those languages have their own "Clippy" to take care of it.


I don't think constructors are the challenging part. It's about lexically scoped destruction. Certainly there are languages that have that and permit garbage collection, however those constructed values are necessarily second-class citizens and behave somewhat differently than ordinary values. There's probably some reasonable middle-ground, like constructors returning an owned reference that explicitly can be turned into an unowned reference, thus opting out of deterministic destruction.


And those languages do offer lexical scoped destruction.

They are only second class in the context people put all GC languages on the same basket, and rather go for the X rewritten in Y blog posts.

Because apparently adding newer languages to CV is cooler than mastering the one they have.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: