On Sunday, 12 November 2023 at 21:55:31 UTC, Paul Backus wrote:
On Sunday, 12 November 2023 at 19:50:02 UTC, Mike Parker wrote:
https://gist.github.com/mdparker/f28c9ae64f096cd06db6b987318cc581

There was a side discussion about how the `extern(C++)` interface affects dmd-as-a-library.

Personally, my number-one complaint with dmd-as-a-library is that I am forced to use `extern(C++)` when creating my own `Visitor` classes.

In [`dmdtags`][1], this requirement has made it necessary for me to implement my own C++-compatible [`Span`][2] and [`Appender`][3] types, just to avoid the C++ mangling errors caused by D's built-in `T[]` slices.

I have no use for overriding AST nodes, but the ability to use `extern(D)` visitors with dmd-as-a-library would be a welcome improvement.

[1]: https://code.dlang.org/packages/dmdtags
[2]: https://github.com/pbackus/dmdtags/blob/v1.1.1/src/dmdtags/span.d [3]: https://github.com/pbackus/dmdtags/blob/v1.1.1/src/dmdtags/appender.d

I have already brought that up to one of our work group meetings regarding dmd as a library as I have stumbled upon this also. We have a solution for this, I'm going to try to implement it this week.

RazvanN
  • DLF September... Mike Parker via Digitalmars-d-announce
    • Re: DLF ... max haughton via Digitalmars-d-announce
    • Re: DLF ... Paul Backus via Digitalmars-d-announce
      • Re: ... RazvanN via Digitalmars-d-announce
        • ... Paul Backus via Digitalmars-d-announce
      • Re: ... Tim via Digitalmars-d-announce
        • ... Paul Backus via Digitalmars-d-announce
          • ... RazvanN via Digitalmars-d-announce
    • Re: DLF ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-announce
      • Re: ... FeepingCreature via Digitalmars-d-announce
        • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-announce
    • Re: DLF ... zjh via Digitalmars-d-announce
      • Re: ... Imperatorn via Digitalmars-d-announce
        • ... zjh via Digitalmars-d-announce

Reply via email to