www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Interoperability, code & marketing

reply Nicholas Wilson <iamthewilsonator hotmail.com> writes:
If [1] gets merged we will have a situation where code[2] is 
required to interoperate with D's slices from C++. I think we 
should have an official repository where such code and 
documentation lives (i.e. on the dlang github). This would also 
be a good place to have links to other interoperability successes 
in D like pyd, dpp, embedr, luad,  autowrap etc. and put the D 
interoperability story out there, coherently and in one place.

Thoughts?

[1]: https://github.com/dlang/dmd/pull/8120
[2]:
template<typename T>
struct __dslice
{
     size_t length;
     T* ptr;

     __dlisce(size_t len, T* p)
     {
         length = len;
         ptr    = p;
     }
     /**
      * Container constructor:
      *
      * Accepts any type U that satisfies `U u; size_t i = 
u.size(); T* = u.data();`
      * This includes types like:
      *      std::vector,
      *      std::string,
      *      std::string_view
      *      std::span
      *
      * TODO: Constrain this properly such that U::value_type == T 
(modulo const)
      * TODO: Make this const correct
      */
     template<typename U>
     __dslice(U& u)
     {
         length = u.size();
         ptr    = const_cast<T*>(u.data());
     }
};
Jul 03 2018
next sibling parent jmh530 <john.michael.hall gmail.com> writes:
On Tuesday, 3 July 2018 at 14:40:52 UTC, Nicholas Wilson wrote:
 [snip] I think we should have an official repository where such 
 code and documentation lives (i.e. on the dlang github). This 
 would also be a good place to have links to other 
 interoperability successes in D like pyd, dpp, embedr, luad,  
 autowrap etc. and put the D interoperability story out there, 
 coherently and in one place.
 [snip]
Sounds like a great idea to me.
Jul 03 2018
prev sibling parent reply Seb <seb wilzba.ch> writes:
On Tuesday, 3 July 2018 at 14:40:52 UTC, Nicholas Wilson wrote:
 If [1] gets merged we will have a situation where code[2] is 
 required to interoperate with D's slices from C++. I think we 
 should have an official repository where such code and 
 documentation lives (i.e. on the dlang github). This would also 
 be a good place to have links to other interoperability 
 successes in D like pyd, dpp, embedr, luad,  autowrap etc. and 
 put the D interoperability story out there, coherently and in 
 one place.

 Thoughts?
In the past A&W became a bit more conservative with creating new repos in the dlang organization and typically only agree to move things there if it "has been proven to be successfully adopted by the community". Though I'm more than happy to create a repo (or move repos) to dlang-community to get the ball rolling.
Jul 03 2018
next sibling parent jmh530 <john.michael.hall gmail.com> writes:
On Tuesday, 3 July 2018 at 15:23:48 UTC, Seb wrote:
 In the past A&W became a bit more conservative with creating 
 new repos in the dlang organization and typically only agree to 
 move things there if it "has been proven to be successfully 
 adopted by the community".

 Though I'm more than happy to create a repo (or move repos) to 
 dlang-community to get the ball rolling.
I would say the value is putting it all together with a consistent experience and story. The final location, dlang-community or otherwise, is maybe less important.
Jul 03 2018
prev sibling parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Tuesday, 3 July 2018 at 15:23:48 UTC, Seb wrote:
 In the past A&W became a bit more conservative with creating 
 new repos in the dlang organization and typically only agree to 
 move things there if it "has been proven to be successfully 
 adopted by the community".

 Though I'm more than happy to create a repo (or move repos) to 
 dlang-community to get the ball rolling.
https://github.com/thewilsonator/interop to a first approximation. need a spec update as well.
Jul 07 2018