News for hackers. Stuff that matters.
Re:I write type-safe generic data structures in C by rectang on Monday June 30, 2025 @03:42PM (#44427066)
Writing extensions for projects that support C extensions but may not support C++ extensions, e.g. many dynamic languages.
Re:I write type-safe generic data structures in C by Snarwin on Monday June 30, 2025 @04:02PM (#44427242)
You can still write the extension in C++ and expose an extern "C" interface.
Re:I write type-safe generic data structures in C by rectang on Monday June 30, 2025 @04:29PM (#44427498)
That's possible, but then the people building your extension need a C++ toolchain.

The question was "please provide examples where switching to C++ involves jumping through even more hoops", and in my view requiring downstream to use a C++ environment when they're expecting to use a C environment qualifies.

Re:I write type-safe generic data structures in C by uecker on Monday June 30, 2025 @04:52PM (#44427739)
True. For me, C++ itself is the maze of hoops I would rather want to avoid.
Re:I write type-safe generic data structures in C by pjmlp on Tuesday July 01, 2025 @08:25AM (#44433203)
Most C compilers are C++ toolchain as well, we are no longer in the 1990's.

Unless of course the project is using such a old compiler.

Re:I write type-safe generic data structures in C by rectang on Tuesday July 01, 2025 @10:19AM (#44434160)
Problems in this domain arise more because you’re wandering off the beaten path for configuration and tooling than because the systems lack absolute capabilities. If you don’t want to build your extension the way that the extension framework expects you, all sorts of annoyances show up. Maintaining an cross-platform compatible C extension is hard enough already.