Hacker News new | ask | show | jobs
by masklinn 5263 days ago
> I agree C is hardly used anymore

Any time you want to provide libraries, you'll likely use C: all languages have C FFI, and it's not possible to have a C++ FFI. So you'd have to rely on `extern C`, and then you have to build a bunch of stuff over your OO code so it can be used procedurally.

Often not worth it, C is the lowest common denominator of languages, if you want to be accessible to all languages... you'll probably use C.

1 comments

> Often not worth it, C is the lowest common denominator of languages, if you want to be accessible to all languages... you'll probably use C.

Personally I see that not so much as a feature of C, but as a limitation of other languages. Interoperability is a Hard Problem(tm) which deserves more thought and effort than it currently receives. It's easy to say 'If you want interoperability, use C' because that's the current state of affairs. It would be better if interop was a solved problem.

You need a common language to interoperate. Currently, C is that common language: everybody understands C.

Some languages have built specific language interop (e.g. Erlang with Java), it's usually broken and often not even as good as C.

> It would be better if interop was a solved problem.

It is: go through C.