3 ms·
> you're stuck between using C++ as basically C, or duplicating every object the API needs to expose Yes, you need to provide the C-like interface on the API b
by xyzzyz 5y ago
> you're stuck between using C++ as basically C, or duplicating every object the API needs to expose
Yes, you need to provide the C-like interface on the API boundary, but internally you can just use normal C++ for everything else. Sure, that C-like interface will not be as nice and comfortable as it would have been with C++ interface, but then again, neither it would be if you used C instead of C++.
> FFI is still one of the (admittedly fewer and fewer) niches where C shines.
No, it’s C linkage that shines, and C++ can use C linkage just fine.