On 02/05/16 14:38, Ola Fosheim Grøstad via Digitalmars-d-learn wrote: > On Friday, 5 February 2016 at 12:35:14 UTC, Artur Skawina wrote: >> call used to print diagnostics. What I saw made me never use or look at D's >> std lib again. Except for meta programing and toy/example programs where it >> doesn't matter. > > What do you use instead? A buffer and Posix write() and aio_write()?
For ad-hoc temporary debugging usually a local wrapper @noinline writeln(A...)(A a) { import std.stdio; std.stdio.writeln(a); } [the reason for @noinline is to not disturb the caller] This is where the `print` function would be useful. It could even be made to work at CT (w/ compiler help; this has been a often requested feature). For programs that output one or few text lines to stdout (results, status updates etc) - `printf` -- it's already there in libc anyway, so zero-cost and GC-free. For everything else - the C/Posix functions. artur