3 ms·
It seems that the C reimplementation is becoming a preferred approach for C FFI in recent languages---at least ones that can afford the cost. Not just D's Impor
by lifthrasiir 5y ago
It seems that the C reimplementation is becoming a preferred approach for C FFI in recent languages---at least ones that can afford the cost. Not just D's ImportC but there are other examples like Python cffi. C++ FFI is another story though.
- melony 5y agoZig has C++ FFI
- lifthrasiir 5y agoZig's C and C++ FFI is basically based on embedding clang, which seems the only way for its level of FFI in case of C++. For C it is much more doable to make a new C compiler specifically for FFI.
- WalterBright 5y agoD's ImportC also allows the C code to be extended with D-ish features, like forward references, compile time function execution, and modules.