r/Compilers • • 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.

18 Upvotes

21 comments sorted by

View all comments

Show parent comment

1

u/General_Purple3060 Jul 21 '26

Thanks. Looking at this from type theory gives a much better explanation than what I had before. I was only observing a phenomenon. Your explanation turns it into something more general.

I definitely had that experience when using GObject. There was always a mental translation between the object model in my head and the C code I was actually writing.

Maybe that's another criterion beyond implementation. If an abstraction exists only as a library, but programmers have to reconstruct the language-level concept in their minds every time they read or write the code, then maybe that abstraction should be represented directly by the language itself.

1

u/kaplotnikov Jul 21 '26

You might be also interested in the article https://github.com/const/const-articles/blob/main/evolution/2025/01-measuring-language-level/MeasuringAbstractionLevelOfLanguages.adoc I'm trying to analyze language evolution process in general with separate horizonal vs. vertical evolution directions. Also there is a prediction for post-OOP paradigm (systems as types).

1

u/General_Purple3060 Jul 21 '26

Thanks for sharing it. I'll read it this week.

The horizontal vs. vertical evolution idea already caught my attention. It sounds like another way to think about how abstractions move from libraries into languages.