News for hackers. Stuff that matters.
Re:Zig's Curious Multi-Sequence for Loops by klyrs on Monday February 27, 2023 @02:27PM (#34960763)
Hi, no need to be so abrasive about it.

> Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.

Python's zip function returns a generator. A generator in zig would look like a function pointer with a closure. If zig were to implement the Python-style "zip" function, constructing the closure, and iterating over the generator, would be significantly slower than the naked "just a for loop" that we see in TFA. And that's not even considering the tuple construction (oops, now we need an allocator) & unpacking.

Ergo, the zig-style "syntactical zip" is higher performance than the Python-style "functional zip". Even when you cut through the baseline performance differences between the languages.

Re:Zig's Curious Multi-Sequence for Loops by masklinn on Monday February 27, 2023 @02:31PM (#34960816)
> Hi, no need to be so abrasive about it.

That's just projection.

> Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.

I'll get right on that as soon as you extend the same courtesy, which you have refused to do at every opportunity.