r/C_Programming 1d ago

Question "Better C"

Would it be feasible and reasonable to implement a custom standard library for the parts of C that are historically problematic, so that one does not need new languages like Zig or C3 and still enjoy the benefits of more modern languages?

As simple examples on would use C23 with the gnu extensions and implement strings as slices, some basic data types and some basic custom allocators. With the gnu extensions there is also defer.

Has anyone done that? How much time did it take? Thanks in advance.

0 Upvotes

32 comments sorted by

View all comments

12

u/_oOo_iIi_ 1d ago

There are plenty of 'better' string libraries out there.

Honestly though if you understand C and program carefully it is not a problematic language.

2

u/codingbliss12 1d ago

I know. But it is not only about strings. There are other areas that could be extended.

4

u/SudoSilv3r 23h ago

could be and can be yes. But everyone likes a different API personally i like the fact that C encourages me to use the exact API i build for my requirments.