On Friday, 22 October 2021 at 05:54:21 UTC, Kirill wrote:
I am not a compiler expert, but I genuinely would like to know why we have Dmain.

I've been looking at the generated assembly code recently and noticed the _Dmain function. I didn't notice it before. Then there is main, where Dmain is called.

Why is that?

in addition to the other answers, there's also the parameters of main:

    int argc, char** argv

becomes

    string[]

so with the D main you're directly in the the D "domain". In theory from that point, you don't need to ever use `strlen` for example.

Reply via email to