3 ms·
It's all relative. I'm very glad that JavaScript doesn't try to make you deal with output buffers, but Rust's goals as a language are different.
by brundolf 5y ago
It's all relative. I'm very glad that JavaScript doesn't try to make you deal with output buffers, but Rust's goals as a language are different.
- qalmakka 5y agoThe problem here is that the uncontested ruler of said system languages, C, has a completely opposite behaviour by default. The C standard clearly states that "When opened, a stream is fully buffered if and only if it can be determined not to refer to an interactive device" (§7.21.5.3.8), which means that generations of developers have learned to always expect buffering when opening files `fopen`. Most higher level languages follow the C library when setting their I/O convention, and this has been the trend for most of the last 40 years. The fact that Rust goes in the opposite direction makes sense from a logical standpoint, but as the article itself shows will almost certainly end up causing performance issues. You can rest assured that people *will* forget to buffer their files because it is something they almost never had to care about in the past.