Update on the D-to-Jai guy: We have real problems with the language

Walter Bright newshound2 at digitalmars.com
Mon Nov 28 22:27:34 UTC 2022


On 11/27/2022 8:12 AM, Steven Schveighoffer wrote:
> Phobos does not make this easy either. Things like std.format are so insanely 
> complex because you can just reach for a bunch of sub-templates. It's easy to 
> write the code, but it increases compile times significantly.

I once tracked just what was being instantiated to format an integer into a 
string. The layers of templates are literally 10 deep. One template forwards to 
the next, which forwards to the next, which forwards to the next, 10 layers deep.

This is not D's fault. It's poor design of the conversion code.


> I still have some hope that there are ways to decrease the template cost that 
> will just improve performance across the board. Maybe that needs a new frontend 
> compiler, I don't know.

Phobos2 needs to take a hard look at all the template forwarding going on.

I've also noticed that many templates can be replaced with 2 or 3 ordinary 
function overloads.



More information about the Digitalmars-d mailing list