Why is D unpopular?
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Sun May 15 13:00:26 UTC 2022
On Sunday, 15 May 2022 at 12:41:20 UTC, zjh wrote:
> On Sunday, 15 May 2022 at 12:33:23 UTC, zjh wrote:
>
>>95%.
>
> It can be completely implemented that ,original 20
> modifications needed, but now only `1/2` modification is needed.
> This can be achieved through various `matching macros` auto
> convert.Like Atila's `dpp` convert.
I think macro expansion should be done in the lexer, differences
between C and D should be resolved in the parser and in the
static analysis after parsing. All content of the macro can be
assumed to be proper C, but things that are passed in as
parameters can refer to D-code and that is where you need to be
careful and perhaps introduce new language constructs if it turns
out that the analysis is too difficult or even change the
semantics of the D language (difficult to say in advance).
I don't think one should encourage to use this feature until it
is done, as then you have no way to change the approach and you
risk being stuck with something that is inadequate.
I think this is a clear cut case of: be prepared to do it
properly or don't do it at all.
More information about the Digitalmars-d
mailing list