r/Compilers • u/General_Purple3060 • Jul 20 '26
From Library Patterns to Language Features: An Overlooked Rule of Language Evolution?
For decades, programmers have solved new problems by creating abstractions in libraries before languages officially supported them.
Some of these patterns eventually became language features. inline is one example. _Generic is another.
But many important abstractions still live only as library conventions.
Large C projects are good examples. GObject/GTK built their own object model. Linux VFS has its own object-oriented design. Many projects repeatedly create similar patterns in different ways.
This makes me wonder:
Is there a point where a commonly repeated library pattern should become a language feature?
What signals that transition?
- widespread adoption?
- compiler optimization opportunities?
- better expression of programmer intent?
Or should some abstractions always remain libraries?
Curious how people think about this boundary.
View all comments
Show parent comment
1
u/General_Purple3060 Jul 20 '26
I strongly agree that control is one of C's defining strengths. Forcing abstractions like coroutines as compiler magic would probably not fit the philosophy of many C developers.
However, I think there is a difference between adding high-level abstractions and providing language support for patterns that programmers already use repeatedly.
Some patterns, such as object models implemented through structs and function pointers, are not about hiding implementation details — they are about expressing relationships and intent. When every project reinvents similar mechanisms, the cost of fragmentation may become higher than providing a small, optional language primitive.
My view is not that C should become a high-level language, but that when a pattern has become common practice, the language can provide a more direct way to express it while keeping control over layout and execution.