Thread overview
Quick C bindings
Sep 28, 2018
Márcio Martins
Sep 28, 2018
Adam D. Ruppe
Sep 29, 2018
Márcio Martins
Sep 28, 2018
bachmeier
Sep 29, 2018
Márcio Martins
Sep 29, 2018
sarn
Oct 02, 2018
Jacob Carlborg
Oct 01, 2018
yawniek
Oct 02, 2018
solidstate1991
September 28, 2018
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?
September 28, 2018
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.
September 28, 2018
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.
September 29, 2018
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).
September 29, 2018
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".
September 29, 2018
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!
September 29, 2018
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.
October 01, 2018
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
October 02, 2018
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
October 02, 2018
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).