Jump to page: 1 2
Thread overview
Emitting C/C++ headers
Feb 16, 2020
Manu
Feb 16, 2020
Stefan Koch
Feb 16, 2020
Manu
Feb 16, 2020
Manu
Feb 16, 2020
Seb
Feb 19, 2020
MoonlightSentinel
Feb 20, 2020
Andre Pany
Feb 20, 2020
MoonlightSentinel
Feb 19, 2020
Gregor Mückl
Feb 20, 2020
Ahmet Sait
Feb 20, 2020
MoonlightSentinel
Feb 21, 2020
Manu
February 15, 2020
Where are we at with this?
There was a flurry of activity last year, but did anything make it
across the line? Is it present in the current release? I can't see any
mention in the compiler reference.
February 16, 2020
On Sunday, 16 February 2020 at 03:53:47 UTC, Manu wrote:
> Where are we at with this?
> There was a flurry of activity last year, but did anything make it
> across the line? Is it present in the current release? I can't see any
> mention in the compiler reference.

If I recall correctly you can throw the -Hc switch to generate c headers.

February 16, 2020
On Sun, Feb 16, 2020 at 2:50 AM Stefan Koch via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Sunday, 16 February 2020 at 03:53:47 UTC, Manu wrote:
> > Where are we at with this?
> > There was a flurry of activity last year, but did anything make
> > it
> > across the line? Is it present in the current release? I can't
> > see any
> > mention in the compiler reference.
>
> If I recall correctly you can throw the -Hc switch to generate c headers.

Is available in releases? Should probably update the command line docs to mention it.
February 16, 2020
On Sun, Feb 16, 2020 at 10:33 AM Manu <turkeyman@gmail.com> wrote:
>
> On Sun, Feb 16, 2020 at 2:50 AM Stefan Koch via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> >
> > On Sunday, 16 February 2020 at 03:53:47 UTC, Manu wrote:
> > > Where are we at with this?
> > > There was a flurry of activity last year, but did anything make
> > > it
> > > across the line? Is it present in the current release? I can't
> > > see any
> > > mention in the compiler reference.
> >
> > If I recall correctly you can throw the -Hc switch to generate c headers.
>
> Is available in releases? Should probably update the command line docs to mention it.

2.90.1 doesn't accept -Hc

 1> COMPILED : error : unrecognized switch '-Hc'
 1>        run `dmd` to print the compiler manual
February 16, 2020
On Sunday, 16 February 2020 at 18:43:39 UTC, Manu wrote:
> On Sun, Feb 16, 2020 at 10:33 AM Manu <turkeyman@gmail.com> wrote:
>>
>> On Sun, Feb 16, 2020 at 2:50 AM Stefan Koch via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>> >
>> > On Sunday, 16 February 2020 at 03:53:47 UTC, Manu wrote:
>> > > Where are we at with this?
>> > > There was a flurry of activity last year, but did anything make
>> > > it
>> > > across the line? Is it present in the current release? I can't
>> > > see any
>> > > mention in the compiler reference.
>> >
>> > If I recall correctly you can throw the -Hc switch to generate c headers.
>>
>> Is available in releases? Should probably update the command line docs to mention it.
>
> 2.90.1 doesn't accept -Hc
>
>  1> COMPILED : error : unrecognized switch '-Hc'
>  1>        run `dmd` to print the compiler manual

Of course, it has never been merged:

https://github.com/dlang/dmd/pull/9971

I think at this point it should just be merged as is, because otherwise no progress will ever happen.
Once merged, it can be improved incrementally.
February 19, 2020
On Sunday, 16 February 2020 at 03:53:47 UTC, Manu wrote:
> Where are we at with this?
> There was a flurry of activity last year, but did anything make it
> across the line? Is it present in the current release? I can't see any
> mention in the compiler reference.

I would use that feature in a heartbeat. There is a lot of code that I would like to rather write in D for use in existing C++ codebases, but maintaining equivalent C++ interface headers is not my idea of fun, so I nix the idea again every time I think about it.

I can't really take the top down approach where D provides the main program and calls into C++ libraries. So tools like dpp - despite being great little helpers - don't apply at all where it would matter most to me.

So is there currently a block for the PR?
February 19, 2020
On Sunday, 16 February 2020 at 20:51:10 UTC, Seb wrote:
> Of course, it has never been merged:
>
> https://github.com/dlang/dmd/pull/9971
>
> I think at this point it should just be merged as is, because otherwise no progress will ever happen.
> Once merged, it can be improved incrementally.

I revived the old PR in [1] to get an initial version merged.This feature is certainly not perfect (yet) but further PRs should take care of that.

[1] https://github.com/dlang/dmd/pull/10801
February 20, 2020
On Wednesday, 19 February 2020 at 23:02:39 UTC, MoonlightSentinel wrote:
> On Sunday, 16 February 2020 at 20:51:10 UTC, Seb wrote:
>> Of course, it has never been merged:
>>
>> https://github.com/dlang/dmd/pull/9971
>>
>> I think at this point it should just be merged as is, because otherwise no progress will ever happen.
>> Once merged, it can be improved incrementally.
>
> I revived the old PR in [1] to get an initial version merged.This feature is certainly not perfect (yet) but further PRs should take care of that.
>
> [1] https://github.com/dlang/dmd/pull/10801

What I do not understand, does this pr only takes care about C++ or also C too?

And the deficiencies you mentioned, are they only C++ related and what is the state on C header generation?

Kind regards
Andre
February 20, 2020
On Thursday, 20 February 2020 at 08:24:12 UTC, Andre Pany wrote:
> What I do not understand, does this pr only takes care about C++ or also C too?

The generator currently creates C++ headers but maybe it could be extended for pure C headers.

> And the deficiencies you mentioned, are they only C++ related and what is the state on C header generation?

There are some remaining bugs / limitations:
- Cannot create separate header files, only only big header (run dmd for each module instead)
- some D features are not implemented yet
- some D Features generate wrong headers
- the header format could be improved

That being said it‘s certainly usable and will probably improve a lot once people start  contributing through  PRs.

PS: Refer to the dshell test in my PR for a runnable example.
February 20, 2020
On Sunday, 16 February 2020 at 03:53:47 UTC, Manu wrote:
> Where are we at with this?
> There was a flurry of activity last year, but did anything make it
> across the line? Is it present in the current release? I can't see any
> mention in the compiler reference.

It would be so much better if we could fix export attribute before this.
« First   ‹ Prev
1 2