On 9/3/2011 10:09 PM, Steven Schveighoffer wrote:
I appreciate feedback, but I think there was a misunderstanding of what this
"review" was for. I think people thought I was proposing this as a ready-to-pull
replacement for std.stdio. That is not the case. It's very much up in the air
and under development. I just wanted to show people some progress and get
feedback (which I've gotten a lot of!)

I'm glad it's early in the process.


For some reason that just seems like a giant wart with a hair sticking out of
it. Why not just use the C stdio buffers?

1. Because most people don't care. I never ever use printf, except when I was
testing my new stdio stuff, and I needed something that worked :) My opinion, if
you are using this line, you are doing something weird, legacy related, or you
are debugging something.

I still use printf a lot. One reason is because it is lightweight - using writeln blows up the size of your .obj file, making it hard to track down a back end bug. This is a long standing gripe I have with writeln.

D is supposed to work well with existing C code. To me, that includes working smoothly with C stdio.


If you read my response to the first post in this thread, you can see my 
rationale.

I understand the desire to do away with C stdio compatibility, but it needs to deliver a *lot* to justify that. I also don't mind if std.stdio needs to peek under the hood of C stdio to get there - yes, it'll be custom for each C library, but the user won't see that.


a *check* to see if it should be flushed is done once per write. Not a flush. A
flush is only done if the check says to (or the buffer is full). I think C's
FILE * checks once per write as well, no?

No. It checks once per char for \n, and once per buffer overflow otherwise.


That is not an OS issue, that is a terminal issue.

It's an OS issue. The OS does the line buffering.

Note that the current std.stdio does not provide this functionality. The only
raw functions are rawRead and rawWrite, which set binary mode. All binary mode
does is on windows enable or disable translation of \r\n to \n. They will not do
what you are asking.

You're right, you have to dip under the hood to the OS protocol to do it.

Reply via email to