Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'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?


I've done a lot of CFFI with Python for this kind of testing in the past. But nowadays I'm also looking at Zig for this.


Has the way Python handles this changed a lot in the last decades? I have never did it because I feared having to chase changes in Python and an ever changing build environment. Mostly a focus thing I knew I alone would not be the one to fix it across all build envs. At the time I was the lone Pythonista now everyone we hire is comfortable with Python so I made the wrong choice.


the point of zig is that there is no FFI to get right


I think (but I'm not sure) that in Zig you can just @cInclude("header.h") or something like that? So your C types are automatically imported/converted to Zig types.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: