betterC examples?

sfp sfp at hush.ai
Fri Apr 30 22:22:05 UTC 2021


I'm developing a C library with Cython bindings, built using 
CMake. I'd like to use D with -betterC to write some new code 
where it would be handy to have access to some more advanced 
language features to keep things readable. For my domain, C is 
totally fine 99% of the time, and rewriting a bunch of C code 
that's already tested and works nicely isn't a priority for me. I 
would like to develop new "modules" using -betterC and freely mix 
them into my existing C code without it being a headache.

So, it would be helpful to see some real -betterC examples. They 
don't need to polished, but substantial enough to help me get my 
bearings. Are there any out there that use CMake? This seems like 
it should be natural: start with a C or C++ CMake project (common 
enough!), and work D into the mix. I'm aware of cmake-d, but 
haven't taken too close of a look at it. It doesn't look like 
it's being actively developed.

To be clear, I'm mostly interested in examples that show how to 
structure a project. I'd like to know what the best way to start 
using D in my current project is, how to call D from C, and how 
to call C from D.

Thanks!


More information about the Digitalmars-d-learn mailing list