www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Quick C bindings

reply =?UTF-8?B?TcOhcmNpbw==?= Martins <marcioapm gmail.com> writes:
Hi y'all!

If you'd be so kind and help me out here with a few 
questions/opinions:

I would like to generate decent D bindings for 
https://github.com/libuv/libuv with as little pain as possible.

What are you guys using these days to generate bindings? I 
remember trying Dstep a few years ago, but it didn't work very 
well for me at the time. What's new in this regard? I've been 
using the ones in dlang.org but have run into some issues, and 
would like to include bindings as part of my project, if it's not 
too painful.

What is the state of shared libraries on the various 
platforms/compilers? I remember they were not supported 
everywhere and by all compilers, as this been addressed?
Sep 28 2018
next sibling parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Friday, 28 September 2018 at 16:39:14 UTC, Márcio Martins 
wrote:
 I would like to generate decent D bindings for 
 https://github.com/libuv/libuv with as little pain as possible.
I just write bindings by hand as I need them, in the file where I want to use them. It isn't really that hard to do for most C libs and doing one function at a time feels not like much more work than actually using the lib. BTW I think libuv is already binded http://code.dlang.org/packages/libuv
 What is the state of shared libraries on the various 
 platforms/compilers? I remember they were not supported 
 everywhere and by all compilers, as this been addressed?
What, exactly do you want to do with them? Using them is well-supported, but creating them is more iffy.
Sep 28 2018
parent =?UTF-8?B?TcOhcmNpbw==?= Martins <marcioapm gmail.com> writes:
On Friday, 28 September 2018 at 16:44:31 UTC, Adam D. Ruppe wrote:
 What, exactly do you want to do with them? Using them is 
 well-supported, but creating them is more iffy.
Create/load/unload. I want to create a hot-reload workflow of smaller components of my projects, since compilation times are becoming an issue, even with DMD, and each developer works on quite contained "sub-modules".
Sep 29 2018
prev sibling next sibling parent reply bachmeier <no spam.net> writes:
On Friday, 28 September 2018 at 16:39:14 UTC, Márcio Martins 
wrote:
 Hi y'all!

 If you'd be so kind and help me out here with a few 
 questions/opinions:

 I would like to generate decent D bindings for 
 https://github.com/libuv/libuv with as little pain as possible.

 What are you guys using these days to generate bindings? I 
 remember trying Dstep a few years ago, but it didn't work very 
 well for me at the time. What's new in this regard? I've been 
 using the ones in dlang.org but have run into some issues, and 
 would like to include bindings as part of my project, if it's 
 not too painful.

 What is the state of shared libraries on the various 
 platforms/compilers? I remember they were not supported 
 everywhere and by all compilers, as this been addressed?
If they're pure C, you can use dpp: https://github.com/atilaneves/dpp Even if you want to work with the bindings, not just call the C functions, you can use the intermediate files that dpp creates. It works with pretty much everything I've thrown at it.
Sep 28 2018
parent =?UTF-8?B?TcOhcmNpbw==?= Martins <marcioapm gmail.com> writes:
On Friday, 28 September 2018 at 21:42:25 UTC, bachmeier wrote:
 If they're pure C, you can use dpp:
 https://github.com/atilaneves/dpp

 Even if you want to work with the bindings, not just call the C 
 functions, you can use the intermediate files that dpp creates. 
 It works with pretty much everything I've thrown at it.
Thanks! Definitely sounds promising. Will give a go!
Sep 29 2018
prev sibling next sibling parent sarn <sarn theartofmachinery.com> writes:
On Friday, 28 September 2018 at 16:39:14 UTC, Márcio Martins 
wrote:
 What are you guys using these days to generate bindings?
Writing them by hand is easy if the library doesn't use the preprocessor much. I often do that for simple jobs. dpp supports preprocessor directives (because it actually does a preprocessor pass).
Sep 28 2018
prev sibling next sibling parent reply Arun Chandrasekaran <aruncxy gmail.com> writes:
On Friday, 28 September 2018 at 16:39:14 UTC, Márcio Martins 
wrote:
 Hi y'all!

 If you'd be so kind and help me out here with a few 
 questions/opinions:

 I would like to generate decent D bindings for 
 https://github.com/libuv/libuv with as little pain as possible.

 What are you guys using these days to generate bindings? I 
 remember trying Dstep a few years ago, but it didn't work very 
 well for me at the time. What's new in this regard? I've been 
 using the ones in dlang.org but have run into some issues, and 
 would like to include bindings as part of my project, if it's 
 not too painful.

 What is the state of shared libraries on the various 
 platforms/compilers? I remember they were not supported 
 everywhere and by all compilers, as this been addressed?
Dstep has got better. Give it a try now.
Sep 29 2018
parent Jacob Carlborg <doob me.com> writes:
On 2018-09-29 20:29, Arun Chandrasekaran wrote:

 Dstep has got better. Give it a try now.
Yes, it's gone through some major changes. Please compile from master if you give it a try. -- /Jacob Carlborg
Oct 02 2018
prev sibling next sibling parent yawniek <yawniek srtnwz.com> writes:
On Friday, 28 September 2018 at 16:39:14 UTC, Márcio Martins 
wrote:
 Hi y'all!

 If you'd be so kind and help me out here with a few 
 questions/opinions:

 I would like to generate decent D bindings for 
 https://github.com/libuv/libuv with as little pain as possible.

 What are you guys using these days to generate bindings? I 
 remember trying Dstep a few years ago, but it didn't work very 
 well for me at the time. What's new in this regard? I've been 
 using the ones in dlang.org but have run into some issues, and 
 would like to include bindings as part of my project, if it's 
 not too painful.

 What is the state of shared libraries on the various 
 platforms/compilers? I remember they were not supported 
 everywhere and by all compilers, as this been addressed?
also this exists: https://github.com/tamediadigital/libuv
Oct 01 2018
prev sibling parent solidstate1991 <laszloszeremi outlook.com> writes:
I would also like something, but for the C11 runtime, as it's 
essential for mago (uses it for unicode strings, rewriting them 
for Phobos would take too much time, and I've already ran out of 
time).
Oct 02 2018