News for hackers. Stuff that matters.
Re:Object-oriented design patterns in C and kernel development by pakl on Wednesday August 27, 2025 @12:16PM (#45041654)
A few years ago Peterpaul developed a lightweight object-oriented system on top of C that was really pleasant to use[0].

No need to pass in the object explicitly, etc.

Doesn't have the greatest documentation, but has a full test suite (e.g., [1][2]).

[0] https://github.com/peterpaul/co2

[1] https://github.com/peterpaul/co2/blob/master/carbon/test/pas...

[2] https://github.com/peterpaul/co2/blob/master/carbon/test/pas...

Re:Object-oriented design patterns in C and kernel development by guerrilla on Wednesday August 27, 2025 @02:17PM (#45043077)
For people wondering what it looks like without the syntactic sugar of carbon then look here [0]. As far as I can see, there's no support for parametric polymorphism.

0. https://github.com/peterpaul/co2/tree/master/examples/my-obj...

Re:Object-oriented design patterns in C and kernel development by 1718627440 on Wednesday August 27, 2025 @02:48PM (#45043452)
Doesn't look much different than GLib the base for the GTK implementation (and other things in GNOME, the GNU Network _Object_ Model Environment).
Re:Object-oriented design patterns in C and kernel development by cryptonector on Thursday August 28, 2025 @04:04PM (#45056454)
Objects yes, classes and inheritance no. Just interfaces please.
Re:Object-oriented design patterns in C and kernel development by saagarjha on Wednesday August 27, 2025 @08:59PM (#45047101)
I feel like Vala tries to fit in this niche too.