Discussion: Porting 58000 lines of D and C++ to jai, Part 0: Why and How

Dukc ajieskola at gmail.com
Fri Nov 25 08:42:44 UTC 2022


On Friday, 25 November 2022 at 08:23:22 UTC, FeepingCreature 
wrote:
> On Friday, 25 November 2022 at 07:31:59 UTC, Dukc wrote:
>> I agree with others here that he must have some problem with 
>> the compile time he could solve without switching the 
>> language. D usually compiles far faster than C++. It may be 
>> because of his memory usage, perhaps that leads to excessive 
>> disk swapping. Should be solvable too.
>
> D has a tendency to give you lots of features, invite you to 
> commit to them, then punish you somewhere way down the line 
> when you can't back out. For instance, format!`` is very 
> clever, but it's probably not beneficial for compile speed to 
> have thousands of recursive instantiations of the formatting 
> code in the compilation set.

Still, by the time your compile times are getting longer but are 
still tolerable, you can investigate and stop generating further 
template bloat. The compile times don't jump from 3 sec to a 
minute overnight, unless it's something that can be fixed easily.

Of course, if the problem of the blog poster is having continued 
to soldier on with compile-time format or regexp or similar, then 
there might not be an easy fix. Still easier than switching 
language though.


More information about the Digitalmars-d mailing list