logoalt Hacker News

mohamedkoubaatoday at 3:10 PM2 repliesview on HN

Isn't this one reason why C is the de facto FFI? OSes happen to use it in their OS ABI and so everything is forced to speak it


Replies

bluGilltoday at 3:27 PM

One reason. The other is C is easy. Any language can implement it and have confidence it can work. (there are other options that are just as easy, but C won). C++ is much harder because of things like function overloading and exceptions - none of it is difficult, but there is a lot more to do and thus more opportunities for bugs.

show 1 reply
pjmlptoday at 3:18 PM

OS written the C, which is what many overlook.

If you are on e.g. z/OS you would be using ILE, Integrated Language Environment, on ChromeOS JS/WASM, on Android either DEX or JNI,...