Thread overview
DPP on the D Blog
Apr 08, 2019
Mike Parker
Apr 08, 2019
Andre Pany
Apr 09, 2019
Atila Neves
Apr 09, 2019
DanielG
Apr 19, 2019
Atila Neves
Apr 19, 2019
Andrea Fontana
April 08, 2019
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/
April 08, 2019
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


April 09, 2019
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.

April 09, 2019
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

April 19, 2019
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.
April 19, 2019
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.