template statistics

Paul Backus snarwin at gmail.com
Wed Jun 3 15:20:07 UTC 2020


On Wednesday, 3 June 2020 at 14:58:59 UTC, Stanislav Blinov wrote:
> On Wednesday, 3 June 2020 at 03:19:37 UTC, Walter Bright wrote:
>
>> The thing is, `writeln("hello")` can be expanded to 
>> `core.stdc.stdio.puts("hello")`. Done.
>>
>> Phobos seems to do a lot of "going around the Horn" instead of 
>> taking the canal.
>
> A good `writeln` would not call into C  at all. Nor would it 
> copy its arguments like four times (therefore potentially not 
> printing what it was given). But Phobos' `writeln` is actually 
> a 
> `encumber_you_with_dependencies_and_thread_safety_because_it_must_be_good_for_you_roundabout_writeln`. So it's OK, we're only missing a plain `writeln`.

To be fair, C's `puts` also includes thread-safety. You need to 
use non-standard functions like `fputs_unlocked` if you want to 
avoid that overhead.


More information about the Digitalmars-d mailing list