Live data from Hacker News

Garbage collection is contrarian

trynova.dev

21–25 of 25 posts

Re: Garbage collection is contrarian

#21

I'm hoping for a future in which humankind looks back with embarrassment at this silly period in its history in which people used to think a leaky and bad abstractions like garbage collection was ever a good approach to deal with resource life-times.

Some problems are just fundamentally easier to solve using cyclic data structures whose lifetime exceeds the scope where they were created, which would be quite difficult to clean up properly in any other way.

Re: Garbage collection is contrarian

#22

I'm hoping for a future in which humankind looks back with embarrassment at this silly period in its history in which people used to think a leaky and bad abstractions like garbage collection was ever a good approach to deal with resource life-times.

Indeed. I also hope we stop using all of these "high-level" languages. So much overhead just so people don't have to learn how to write proper optimized machine code. It's super-trivial to write a website directly in that too, and it only takes a bit longer, but it is almost twice as fast.

Re: Garbage collection is contrarian

#23
post #20

Earlier quoted context omitted.

Monkey's paw: you get your wish, but so does someone who wants RAII and single-use-malloc to be left behind as a leaky and bad abstractions. We all happily march into a future where only arena allocation is allowed, and when the arena is overfull it can only be fully reset without saving data. Copying still-used data out if it before reset is not allowed, as that's a copying half-space garbage collector. Reference co…

Well, to be fair, RAII is a leaky abstraction. For example, if your programme crashes there's no guarantee that you'll ever give the resources back. See https://en.wikipedia.org/wiki/Resource_acquisition_is_initia...

> See https://en.wikipedia.org/wiki/Resource_acquisition_is_initia...

This example is specific to C++

> (..) if your programme crashes there's no guarantee that you'll ever give the resources back.

What guarantees can you have from a "crashing program", and by what definition of crashing?

> RAII is a leaky abstraction

Any abstraction is leaky if you look close enough.

Re: Garbage collection is contrarian

#24
post #20

Earlier quoted context omitted.

Well, to be fair, RAII is a leaky abstraction. For example, if your programme crashes there's no guarantee that you'll ever give the resources back. See https://en.wikipedia.org/wiki/Resource_acquisition_is_initia...

> See https://en.wikipedia.org/wiki/Resource_acquisition_is_initia ... This example is specific to C++ > (..) if your programme crashes there's no guarantee that you'll ever give the resources back. What guarantees can you have from a "crashing program", and by what definition of crashing? > RAII is a leaky abstraction Any abstraction is leaky if you look close enough.

> What guarantees can you have from a "crashing program", and by what definition of crashing?

You might like https://www.usenix.org/conference/hotos-ix/crash-only-softwa...

Re: Garbage collection is contrarian

#25

I'm hoping for a future in which humankind looks back with embarrassment at this silly period in its history in which people used to think a leaky and bad abstractions like garbage collection was ever a good approach to deal with resource life-times.

Indeed. I also hope we stop using all of these "high-level" languages. So much overhead just so people don't have to learn how to write proper optimized machine code. It's super-trivial to write a website directly in that too, and it only takes a bit longer, but it is almost twice as fast.

I'm a big fan of high-level languages and abstractions. I'm just not a fan of bad abstractions.
Post reply on HN