Harlan Haskins

@harlan@mastodon.social

I think the fact that Task closures don't require explicit self is a huge footgun :(

December 11, 2025 at 4:17:37 PM

is it? Isn’t it like UIView.animate, where its generally regarded safe to strongly capture self

Not if you save the Task to cancel it later, which is the case in my experience for most long-running tasks that await over async sequences

Agree! Also allowing you to call throwing functions without a do/catch block is really bad ☹️

Yes! It took me a bunch of debugging to find this out the hard way.

Having closures w/o a GC is the real footgun 🏃‍♀️

Explicit self is just one special case that doesn’t deserve an own solution. The problem affects any capture, as each capture might also refer to self or produce other cycles.
I think what you really want is explicit capture lists, not explicit self in the body. (the { [self, a, b] in … } thing)

yes, but for the unrelated reason that I just don’t like implicit self ducks

I don’t think that is unrelated and also I agree!

Elk Logo

Elk is in Preview!

Thanks for your interest in trying out Elk, our work-in-progress Mastodon web client!

Expect some bugs and missing features here and there. we are working hard on the development and improving it over time.

Elk is Open Source. If you'd like to help with testing, giving feedback, or contributing, reach out to us on GitHub and get involved.

To boost development, you can sponsor the Team through GitHub Sponsors. We hope you enjoy Elk!

三咲智子 Kevin DengPatakAnthony FuDaniel Roe

The Elk Team