misc questions about a DUB package

9il ilyayaroshenko at gmail.com
Wed Jul 15 02:20:11 UTC 2020


On Tuesday, 14 July 2020 at 20:56:06 UTC, DanielG wrote:
> I have some D-wrapped C libraries I'm considering publishing to 
> DUB, mainly for my own use but also for anybody else who might 
> benefit. I've never done this before so I have some questions:
>
> - Should there be any obvious relationship between the DUB 
> package version and the version of the C library? What are the 
> best practices for connecting the two, if at all?

No. Usually, a DUB package supports a range of C library version 
or just a fixes set of C API. The version behavior of the dub 
package is up to you. Usually, D API changes more frequently than 
the underlying C library.

> - I'm very much about the "full fat" D experience, so I 
> presently have no intention of designing my D wrappers for 
> betterC/the-runtime-is-lava usage. That being the case, is 
> there any compelling reason to avoid initializing the C library 
> in a 'shared static this()' method? (ie automatically)

Yes. For a large project and services, it may be required to 
initialize shared a library with a function call instead of at 
startup. Furthermore, missing dependency may not be a fatal issue 
for service. In other hand, it all depends on your usage case.


More information about the Digitalmars-d-learn mailing list