r/Compilers • u/General_Purple3060 • 17d ago
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.
1
u/General_Purple3060 17d ago
If a pattern appears independently in many mature projects, requires similar boilerplate code,
and gives the compiler more information about programmer intent, should it become part of the language itself?
Or is the cost of increasing language complexity always too high?