Best way to use large C library in D as of 2024

Lance Bachmeier no at spam.net
Fri Apr 12 21:22:10 UTC 2024


On Friday, 12 April 2024 at 18:45:21 UTC, Chris Piker wrote:

> Even though DMD can't compile some C code, that's pretty much a 
> non-issue for me anyway.  In my environment the servers are all 
> Linux so "apt-get" (or equivalent) typically provides a 
> pre-compiled dependency.  Being able to list a package as a 
> system dependency and then just call it from D with no 
> interface code is a Big Freaking Deal!
>
> Compared to Python interfaces this is a huge improvement.  It 
> makes D an even better replacement for the mixed mode python + 
> C development I was doing before switching to D for new 
> projects.

I agree that it's really good, but the issues I listed were just 
examples of the things I came across, and I know there are a 
decent number of other open issues for ImportC. What I'd prefer 
to avoid is having people try it out and concluding that it's not 
ready. Kind of like when I tried out Zig. Everyone was saying 
it's this great language but my trial was brief and I haven't 
been tempted to try it since.

Header files are a different story. They really should "just 
work" based on my experience. Other things like compiling large 
libraries or translating C code to D should probably be more in 
the camp of "experience reports" posted on individual blogs, and 
they should talk about both the successes and the edge cases.


More information about the Digitalmars-d-learn mailing list