Is C API alive or not
I want to write a wrapper for OpenCV using different language. For obsious reasons I can only use C API. And I have two alternatives: write my own wrappers over C++ code and expose it OR I can take existing C API, but the drawback of this approach is my fear that C bindings may be abandoned.
I'm starting a new shiny project, but I don't want to write extra C code when I can reuse existing one. Or I can't? Because as I see multiple functions are missing, even very basic ones, like mat::zeroes
or mat::eye
.
if i may ask: what is the nature of your "new shiny project" ? some kind of ffi bindings ? (to what ?)
I'm trying to port OpenCV interfaces to Rust that it may be used from safe language (e.g. see calcHist, looks pretty good imho). But for Now i have to write wrappers manually, e.g. mat.cc which is pretty annoying. So I looked forward code generators, but unfortunately they work fine with pure C code only, because they cannot support advanced C++ features and automatically generate code that works fine in all circumstances. This is why I wondered if C API can be an option.
"I'm trying to port OpenCV interfaces to Rust" -- cool ;)
"code generation" -- you've seen this and this ?
adapting a ~1000 lines python monster (which to 90% covers weird edge cases) might look daunting, but on the other hand, doing things manually, like those folks try will result in a "toy example", that only covers the 5% most used cases. (which again IS cool, too, don't get me wrong. problem is, if you deviate only a millimeter from it, you're staring into an open abyss)
I feel that you are right. However, I don't believe I can handle it, because I'm not familiar with python at all, and my codegen experience ends on some plays with Roslyn. However, I'l try to give it a shot anyway, just to not be sorry for not even trying.
you ARE trying, and that's good !