June 05
On Wednesday, 4 June 2025 at 19:59:27 UTC, Ali Çehreli wrote:
> On 6/2/25 11:06 PM, Paul Backus wrote:
>
> > The main thesis (quoted from the article's conclusion) is
> this:
> >
> >> These [unstructured concurrency] primitives are dangerous
> even if we
> >> don't use them directly, because they undermine our ability
> to reason
> >> about control flow and compose complex systems out of
> abstract modular
> >> parts, and they interfere with useful language features like
> automatic
> >> resource cleanup and error propagation.
>
> The garbage collector wins in that scenario because it removes the need for "automatic resource cleanup" e.g. of C++.
>
> That fact was pointed out to me by a colleague years ago: The sender threads generate messages, the receiver threads use those messages, and thanks to the garbage collector, nobody cares about the ownership of messages.

The linked article mostly talks about Python and Go, which are both garbage-collected languages. The "resources" referred to here are things like open files and network connections, which are not reclaimed by the GC.
June 05
On Wednesday, 4 June 2025 at 21:48:07 UTC, Sebastiaan Koppe wrote:
> Now, it must be said, the GC does help a lot in lock-free algorithms. Just look into hazard pointers to see what madness you have to resort to without a GC.

It's not a big deal, you can use a library for it (C++ is getting it in its stdlib: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1121r3.pdf) just like your GC which lives in the code space you didn't write yourself.
June 05
On Thursday, 5 June 2025 at 08:00:35 UTC, Araq wrote:
> On Wednesday, 4 June 2025 at 21:48:07 UTC, Sebastiaan Koppe wrote:
>> Now, it must be said, the GC does help a lot in lock-free algorithms. Just look into hazard pointers to see what madness you have to resort to without a GC.
>
> It's not a big deal, you can use a library for it (C++ is getting it in its stdlib: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1121r3.pdf) just like your GC which lives in the code space you didn't write yourself.

There is probably a parallel universe where I did actually end up writing a GC for D.
June 05
On Thursday, 5 June 2025 at 14:30:09 UTC, Sebastiaan Koppe wrote:
> There is probably a parallel universe where I did actually end up writing a GC for D.

On Thursday, 5 June 2025 at 14:30:09 UTC, Sebastiaan Koppe wrote:

I fail to see the point. So write a hazard pointer implementation too and see what is easier.
June 05
On Thursday, 5 June 2025 at 14:41:09 UTC, Araq wrote:
> On Thursday, 5 June 2025 at 14:30:09 UTC, Sebastiaan Koppe wrote:
>> There is probably a parallel universe where I did actually end up writing a GC for D.
>
> On Thursday, 5 June 2025 at 14:30:09 UTC, Sebastiaan Koppe wrote:
>
> I fail to see the point. So write a hazard pointer implementation too and see what is easier.

My point was that I am grateful there is a GC and that I don't have to write a hazard pointer library because of it.

It would be a bit odd to follow that up by implementing one, so I'm not going to. Maybe in the nogc-verse though ;)
1 2
Next ›   Last »