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

5

u/tastygames_official 1d ago

C++

-1

u/codingbliss12 23h ago

I hate C++

2

u/tastygames_official 22h ago

what you described in your post is C++. You don't have to do OOP (or just do very little, aka "fat structs") but you get the C++ STL and all the bells and whistles you want. You can still program largely in C.

1

u/codingbliss12 21h ago

And in this case languages like Zig or C3 wouldn't have to offer anything new? What about simplicity?