www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Emitting C/C++ headers

reply Manu <turkeyman gmail.com> writes:
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.
Feb 15 2020
next sibling parent reply Stefan Koch <uplink.coder googlemail.com> writes:
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.
Feb 16 2020
next sibling parent Manu <turkeyman gmail.com> writes:
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.
Feb 16 2020
prev sibling parent reply Manu <turkeyman gmail.com> writes:
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
Feb 16 2020
parent reply Seb <seb wilzba.ch> writes:
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.
Feb 16 2020
parent reply MoonlightSentinel <moonlightsentinel disroot.org> writes:
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
Feb 19 2020
parent reply Andre Pany <andre s-e-a-p.de> writes:
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
Feb 20 2020
parent MoonlightSentinel <moonlightsentinel disroot.org> writes:
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.
Feb 20 2020
prev sibling next sibling parent Gregor =?UTF-8?B?TcO8Y2ts?= <gregormueckl gmx.de> writes:
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?
Feb 19 2020
prev sibling parent reply Ahmet Sait <nightmarex1337 hotmail.com> writes:
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.
Feb 20 2020
next sibling parent MoonlightSentinel <moonlightsentinel disroot.org> writes:
On Thursday, 20 February 2020 at 17:18:28 UTC, Ahmet Sait wrote:
 It would be so much better if we could fix export attribute 
 before this.
Enhancing other aspects of C(++) interop is certainly beneficial. But there's no benefit in good work (that has already been done) going to waste in a stalled PR.
Feb 20 2020
prev sibling parent Manu <turkeyman gmail.com> writes:
On Thu, Feb 20, 2020 at 9:20 AM Ahmet Sait 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.
It would be so much better if we could fix export attribute before this.
Fix it in post. I have a bunch of PR's I want to make against this, so it would be nice for this to merge asap.
Feb 20 2020