3 ms·
> I just used C. D has a C subset, in that there is a 1:1 correspondence. If you write code this way (I have) there are zero calls to the GC, and you will get
by WalterBright 10y ago
> I just used C.
D has a C subset, in that there is a 1:1 correspondence. If you write code this way (I have) there are zero calls to the GC, and you will get the same code generated as a C compiler would (after all, all three D compilers use C compiler code generators).
The reason I have written code this way is when I've converted C code to D. Once it is in D, then I start refactoring it to use D idioms, but that's not necessary. I.e. you can use D as a C compiler.
(Likely the most tedious issue translating C to D is if the C code uses the preprocessor as a metaprogramming language. Fortunately, this is unusual.)