I'm too dumb for Zig's new IO interface

I don’t understand your message, what you are trying to express, or its intention.

What the heck?

2 Likes

Just an ordinary heck. Nothing special.

i think they were asking andrew to stop doing otherthings and address current issues with the new interfaces.

Regardless, they are late to the party he already did, should be available in a couple of hours. Friendly ping @x06a

Can we not do this passive-aggressive nonsense? This is a place for friendly discussion about zig.

12 Likes

I am glad 0.15.2 went out, thank you!

It turns out some of my issues were my mistakes, some of them were caused by a bug in the std.io.Reader, which is fixed now, but I’m not sure if anything was done about the infinite loop which can happen if you misconfigure buffer sizes.

If you have multiple readers chained together, and the buffer size is not enough, the peekGreedy(x + 1) can keep waiting for more bytes and they will never come. This is because the other reader’s buffer may be too small.

It is obviously a bug and one could say it’s documentation issue but it’s unnecessarily hard to figure this out and there’s even no way to detect this before the first read is executed. (and the way you find out is that the process will hang forever)

2 Likes

it is questionable why you have multiple readers chained, each with a buffer. The buffers should generally only be at the end of the chain.

Is it measurably slower without intermediary buffers?

I haven’t tried without buffers but I suppose codepage decoding (cp → utf-8) is the kind of thing which you want to do in bigger chunks… Similar to compression/decompression IMHO