News for hackers. Stuff that matters.
Re:Show HN: Ts-Chan – Go-Like Concurrency Primitives for Typ... by yunohn on Monday November 06, 2023 @05:43AM (#38160939)
Excuse my multiple comments, just trying to understand this better since I’m very intrigued by your library.

What does the JS “if x != x” check do? I don’t see the equivalent in the golang example?

Re:Show HN: Ts-Chan – Go-Like Concurrency Primitives for Typ... by joeycumines on Monday November 06, 2023 @06:41AM (#38161266)
From the concurrent prime sieve example?

That's just something I copy and pasted from the documentation for the benchmark package I used. Allegedly, it is to prevent "certain compiler optimisations", which is something I'm familiar with when it comes to benchmarking Go code, for example.

I lack specific knowledge as to whether it's actually necessary, sorry :)

Re:Show HN: Ts-Chan – Go-Like Concurrency Primitives for Typ... by yunohn on Tuesday November 07, 2023 @12:37AM (#38173642)
Ah, gotcha!

I thought maybe it was something to do with concurrency, and somehow x is affected by a race condition there.