5 ms·
I know that in other languages, one obstacle for "just compile the C files" is that the target language might not have pointers and thus have difficulty represe
by ufo 2y ago
I know that in other languages, one obstacle for "just compile the C files" is that the target language might not have pointers and thus have difficulty representing things such as return-by-pointer.
I suppose in D this was less of an issue because D has pointers?
- WalterBright 2y agoI'm not sure what you mean.
- ufo 2y agoA foreign function interface that's based on parsing C files must translate C types and interfaces into types and interfaces of the target language. I suppose it helped that D's type system has many similarities with C, including support for pointers. (The issue with return-by-pointer is that in C it's common to use the return value for an error code and use pointer arguments to pass data back to the caller. These are awkward to map to a target language that doesn't have pointers)