Why is D unpopular?
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Sat May 14 06:24:15 UTC 2022
On Saturday, 14 May 2022 at 05:58:48 UTC, Ola Fosheim Grøstad
wrote:
> On Saturday, 14 May 2022 at 05:45:03 UTC, rikki cattermole
> wrote:
>> Adam's mixinC idea is much more likely to "just work" in all
>> cases that I think that is the direction we ought to be going
>> in.
>
> What will it look like in macro intensive code? If you end up
> writing C then the point is lost. What do you do with macros
> that expand function signatures followed by a body?
>
> The only solution that can work in most cases is to align D
> more with C (or rather the oppsite) and reflect that in the AST.
You need to do the macro expansion in the lexer, then inject C/D
context switch tokens used by the parser, then you inject C/D AST
nodes if there are semantic differences, or annotate AST nodes
with the differences. That way you can have a C signature
followed by a D body.
Anything short of this is a waste of time IMHO.
The last thing the language needs is clunky interop.
More information about the Digitalmars-d
mailing list