3 ms·
I'd say there are roughly three classes of C compatibility: Tier 1 is C++ and ObjC, where you can use C headers nearly directly. Tier 2 is where you have to c
by qznc 8y ago
I'd say there are roughly three classes of C compatibility:
Tier 1 is C++ and ObjC, where you can use C headers nearly directly.
Tier 2 is where you have to create (and maintain) bindings, but you can map practically everything. Here is Rust, D, Nim, Go, etc. More work than tier 1 is necessary but no loss of performance (except maybe inlining and macros). There are distinctions within this class depending on how well macros etc can be mapped, but usually people map to the ABI instead of the API.
Tier 3 is where you cannot map directly and inefficient adapters must be made. This is for example Java, which does not have struct or size_t. Also nearly all scripting languages (Python, Ruby, Lua, etc).