News for hackers. Stuff that matters.
Re:Show HN: Ts-Chan – Go-Like Concurrency Primitives for Typ... by mattlondon on Monday November 06, 2023 @02:55AM (#38159885)
It might be nice to implement go's defer here too (e.g. for closing the channel) to keep some of the DX.

I guess a JavaScript defer could just be enqueueMicrotask and an anonymous arrow function?

Re:Show HN: Ts-Chan – Go-Like Concurrency Primitives for Typ... by joeycumines on Monday November 06, 2023 @03:11AM (#38159962)
If you want it to run on exiting the function in reverse order, something like Python's context managers would probably be necessary.

I've dabbled in that too, though I don't actually use it for anything, currently: https://github.com/Mcsavvy/contextlib/pull/1