top | item 46589285

(no title)

aapoalas | 1 month ago

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 counting is of course not allowed either as that's also garbage collection. Everyone is blessed...?

discuss

order

eru|1 month ago

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...

ameixaseca|1 month ago

> 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.