News for hackers. Stuff that matters.
Re:How to write better game libraries by LucaSas on Sunday December 08, 2019 @09:38AM (#21736062)
Hi, I mention in the article that "It is easier in general for a C++ user to use a C library than it is for a C user to use a C++ library." which is where the advice comes from.
Re:How to write better game libraries by yoz-y on Sunday December 08, 2019 @10:51AM (#21736465)
I agree. But "wants" is a term indicating personal preference. I understand that C is best suited for maximum portability and performance. But as a C++ developer I prefer libraries that come with C++ interfaces (and you do mention that it is good to provide a C++ wrapper as well).
Re:How to write better game libraries by LucaSas on Sunday December 08, 2019 @11:38AM (#21736707)
Thanks a lot for your feedback. I decided to remove that since I think you are right about indicating personal preference. I do not want this article to be a list of preferences but rather an analysis of the considerations that popular C libraries make (eg: stb, sokol, etc) and that new authors should also reason about.
Re:How to write better game libraries by matheusmoreira on Sunday December 08, 2019 @06:30PM (#21739226)
Because the binary interfaces generated by C libraries are simple and therefore universally supported. It's just normal symbols and calling conventions. Conforming to this ABI benefits users of every other language, not just C++.

C++ ABIs are rather complex and much harder to interface with. The existence of concepts like virtual functions and exceptions significantly complicates the implementation of foreign language interfaces.

https://wiki.osdev.org/System_V_ABI https://itanium-cxx-abi.github.io/cxx-abi/abi.html