Earlier quoted context omitted.
Yes: https://dlang.org/spec/importc.html The D compiler(s), as Zig, can be used to compile C code... and D code can import C files as if they were D modules (as in Zig, there are some special types to represent C strings and other types that are not exactly the same).
Thanks for that! I'm a big fan of D, as someone who primarily codes in C# and Python. I really wish a big company would take on D in a serious way that puts it on the map significantly. It is an underrated language in my opinion.
Using Zig to Unit Test a C Application
51–54 of 54 posts
Re: Using Zig to Unit Test a C Application
#52However, for the complete newcomer to Zig, this post seems a bit convoluted in this presentation.
What about the Zig authors do a step by step tutorial on how to leverage Zig to implement tests in a C codebase?
Would be a great entry point for the broader community!
Re: Using Zig to Unit Test a C Application
#53I've done this where I use python's ctypes library to write tests for a c codebase. This feels very similar in that it can be tricky to get the type interop correct the first time around. What other strategies/solutions do people like to use for testing their c projects?
Re: Using Zig to Unit Test a C Application
#54Earlier quoted context omitted.
Thanks for that! I'm a big fan of D, as someone who primarily codes in C# and Python. I really wish a big company would take on D in a serious way that puts it on the map significantly. It is an underrated language in my opinion.
Absolutely. It was way ahead of its time. And it's improving, albeit slowly. With stuff like @safe, @nogc, pure, betterC[1], and its unmatched metaprogramming, it's a more modern language than most of the newer languages popping up. [1] https://dlang.org/blog/2017/08/23/d-as-a-better-c/