6 ms·
In practice, a lot of software is written in C because it depends on interfaces that are defined in terms of their C APIs, without caring all that much about pe
by naniwaduni 7y ago
In practice, a lot of software is written in C because it depends on interfaces that are defined in terms of their C APIs, without caring all that much about performance.
- pjmlp 7y agoPlenty of safer languages offer seamless C FFI, no need to write software in C just because those interfaces are defined as C ones. H2PAS was already a thing in MS-DOS days, just as possible example.
- naniwaduni 7y agoOnly feasible if you only use libraries which maintain ABI compatibility scrupulously or if you just take a narrow view of portability. There's a lot of code in the wild which maintains compatibility only at the C source level using preprocessor macros. FFIs are a nice toy for one-offs or integrating with vendored dependencies. Most never get past that stage.
- pjmlp 7y agoNo C library is changing their ABI every couple of seconds, and plus many of those tools understand C header files, quite feasible to fix broken bindings every now and then.
- naniwaduni 7y agoThe problem isn't changes, it's accommodating multiple versions. Even figuring out where to find headers is not necessarily easy if you're not the local C compiler, for whom the tooling must only begrudgingly exist.