Is it feasible to slowly rewrite a C++ codebase in D?

Dukc ajieskola at gmail.com
Fri Jul 13 08:05:12 UTC 2018


On Wednesday, 20 June 2018 at 18:47:10 UTC, Jordi Gutiérrez 
Hermoso wrote:
> Now, as I understand it, I would need to begin with making 
> `main` a D function, because D needs to initialise the runtime. 
> Is this correct?

No. Some initialization is required if you use the GC, as I 
understand it. But there's no rule it has to be done in a D main 
function, you can initialize it from anywhere you like.

And if you avoid using stuff that requires the runtime (I'm not 
sure what it constitutes in addition to GC. Perhaps classes, 
perhaps typeid, perhaps static constructors and destructors) you 
do not need to initialize it. -betterC style stuff can be done 
without it, and as I said it does not need the -betterC switch 
anymore, at least in LDC.


More information about the Digitalmars-d-learn mailing list