www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - DPP on the D Blog

reply Mike Parker <aldacron gmail.com> writes:
I've just published a new Project Highlight, this one on dpp. 
Atila shares some anecdotes about how and why the project came 
together. He'll be speaking more about it at DConf next month.

The blog:
https://dlang.org/blog/2019/04/08/project-highlight-dpp/

Reddit:
https://www.reddit.com/r/programming/comments/bas2my/dpp_include_c_and_c_headers_directly_in_your_d/

Somewhere on HN:
https://news.ycombinator.com/
Apr 08 2019
next sibling parent reply Andre Pany <andre s-e-a-p.de> writes:
On Monday, 8 April 2019 at 10:28:04 UTC, Mike Parker wrote:
 I've just published a new Project Highlight, this one on dpp. 
 Atila shares some anecdotes about how and why the project came 
 together. He'll be speaking more about it at DConf next month.

 The blog:
 https://dlang.org/blog/2019/04/08/project-highlight-dpp/

 Reddit:
 https://www.reddit.com/r/programming/comments/bas2my/dpp_include_c_and_c_headers_directly_in_your_d/

 Somewhere on HN:
 https://news.ycombinator.com/
Great functionality and great article. I just realized DPP would be a perfect candidate for a Dub plugin. Just write the .dpp files, add the dependency to DPP in dub.json and the Dub plugin mechanism (to be implemented) will do all the rest for you. Kind regards Andre
Apr 08 2019
parent Atila Neves <atila.neves gmail.com> writes:
On Monday, 8 April 2019 at 11:30:48 UTC, Andre Pany wrote:
 On Monday, 8 April 2019 at 10:28:04 UTC, Mike Parker wrote:
 I've just published a new Project Highlight, this one on dpp. 
 Atila shares some anecdotes about how and why the project came 
 together. He'll be speaking more about it at DConf next month.

 The blog:
 https://dlang.org/blog/2019/04/08/project-highlight-dpp/

 Reddit:
 https://www.reddit.com/r/programming/comments/bas2my/dpp_include_c_and_c_headers_directly_in_your_d/

 Somewhere on HN:
 https://news.ycombinator.com/
Great functionality and great article. I just realized DPP would be a perfect candidate for a Dub plugin. Just write the .dpp files, add the dependency to DPP in dub.json and the Dub plugin mechanism (to be implemented) will do all the rest for you.
John Colvin was working on this.
Apr 09 2019
prev sibling parent reply DanielG <simpletangent gmail.com> writes:
re: the difficulties of interfacing D with certain types of C/C++ 
code ...

Has anybody looked into something like a JavaCpp[1] approach for 
D?

Instead of trying to get D to speak directly with C++, or 
translating C/C++ headers to D, why not use special annotated D 
code to generate a middleman .cpp file, which then exports a 
D-friendly interface? Then all the dirty work gets handled by a 
C++ compiler.

Wouldn't that be an order of a magnitude easier to implement?

[1]: https://github.com/bytedeco/javacpp
Apr 09 2019
parent reply Atila Neves <atila.neves gmail.com> writes:
On Tuesday, 9 April 2019 at 21:11:28 UTC, DanielG wrote:
 re: the difficulties of interfacing D with certain types of 
 C/C++ code ...

 Has anybody looked into something like a JavaCpp[1] approach 
 for D?

 Instead of trying to get D to speak directly with C++, or 
 translating C/C++ headers to D, why not use special annotated D 
 code to generate a middleman .cpp file, which then exports a 
 D-friendly interface? Then all the dirty work gets handled by a 
 C++ compiler.

 Wouldn't that be an order of a magnitude easier to implement?

 [1]: https://github.com/bytedeco/javacpp
I've considered this, and am still considering it, despite not having heard of javacpp before. Thanks for the link, I'll take a look.
Apr 19 2019
parent Andrea Fontana <nospam example.org> writes:
On Friday, 19 April 2019 at 09:04:50 UTC, Atila Neves wrote:
 On Tuesday, 9 April 2019 at 21:11:28 UTC, DanielG wrote:
 re: the difficulties of interfacing D with certain types of 
 C/C++ code ...

 Has anybody looked into something like a JavaCpp[1] approach 
 for D?

 Instead of trying to get D to speak directly with C++, or 
 translating C/C++ headers to D, why not use special annotated 
 D code to generate a middleman .cpp file, which then exports a 
 D-friendly interface? Then all the dirty work gets handled by 
 a C++ compiler.

 Wouldn't that be an order of a magnitude easier to implement?

 [1]: https://github.com/bytedeco/javacpp
I've considered this, and am still considering it, despite not having heard of javacpp before. Thanks for the link, I'll take a look.
Also SWIG (for d too) does something like this.
Apr 19 2019