DEV Community

Cover image for The secret life of Functions: they are much more than we thought
Kevin
Kevin

Posted on

The secret life of Functions: they are much more than we thought

Three centuries ago, Scottish philosophers taught the world how to reason. Today, Glasgow teaches our machines to think. Functional programming is quietly shaping the future of software — and AI loves it.

In the 18th century, while France was discovering the Enlightenment and bringing reason into the public sphere, another intellectual revolution was unfolding further north — in Scotland.

In Edinburgh, Glasgow, and Aberdeen, thinkers like David Hume, Adam Smith, Thomas Reid, and Francis Hutcheson were laying the foundations of an empirical and analytical philosophy — a philosophy of reality grounded in observation, rigor, and methodological doubt.

We often forget how much the French Enlightenment owes to the Scottish Enlightenment.

Montesquieu and Rousseau read Hume; Voltaire corresponded with Smith.

The very idea of human progress through rational inquiry came from the North.

The Scots brought the method, the precision, the refusal of dogma — while France brought the passion, the universal ideals, the belief that reason could elevate humanity.

It was an alliance of heart and mind, of theory and practice.


From Hume to Haskell: the New Age of Reason

Three centuries later, a similar movement — quieter, but profound — was born again in Glasgow, this time in the realm of computer science.

There, in the 1980s, emerged Haskell, a language designed not merely as a technology, but as a living theory of functional thought.

And once again, Scotland embodied a certain intellectual temperament: rigorous, empirical, and grounded in structure and coherence - while other schools of thought, most notably object-oriented programming, embraced pragmatism, creativity, and sometimes, productive chaos.

Glasgow University

In Glasgow, the Glasgow Haskell Compiler (GHC) is more than just a compiler — it’s a laboratory of philosophy.

It embodies a vision of code as a coherent system of laws, where purity (absence of side effects), transparency (functions as logical transformations), and elegance (composition over instruction) are moral virtues.

Object-oriented programming (OOP) conquered the software world of the 1990s and 2000s because it spoke a seductive language: objects, inheritance, encapsulation. It used social (e.g. parent, child...), almost political metaphors (e.g. public or private, class...).

But that rabbit success also obscured its turtle sibling: one more mathematical, taking advantage of academic time, the absence of financial pressure, reasoning slowly about human reasoning itself, with very few but deep questions in mind:

How do we think? What are the underlying structures of our most diverse and fruitful theories (physics, mathematics, biology...)? Can we use them to invent a language that stimulates the best aspects of our thinking, thereby giving us greater power over our dialogue with machines? Can we invent a language that allows us to better communicate our best ideas, promoting their emergence?

OOP uses functions, and FP uses objects. Of course. There is no impenetrable wall between the two worlds. But for Glasgow, the central question is rather what to emphasize, and in the name of what theoretical vision, in a world perceived as transformations (morphisms), rather than states or objects (morphs). As arrows, rather than dots.


When Abstraction boiled down to poorly told Stories

For a long time, functional programming (FP) was too abstract, too austere, for newcomers. It suffered from a lack of pedagogy. In reality, Haskell itself draws inspiration from even more distant ancestors. And these ideas date back to the earliest research in Artificial Intelligence (e.g. Lisp). Clearly, the time was not ripe for widespread sharing, but rather for cutting-edge academic advances.

There were no tutorials, no approachable books, no teachers starting from zero. Only visionaries.
Instead, newcomers were bombarded with words like monads, functors, and categories — with little intuition behind them.

It wasn’t that FP was that difficult; it was that its story hadn’t been told yet.

Where OOP offered its metaphors — objects, messages, hierarchies — FP spoke in the language of mathematics, and we couldn't see how these abstractions were potentially closer to human thought. We couldn't see the mountain behind the one made of objects, because people were already starting to climb the latter.

Today, that has changed.

Thanks to the internet, to YouTube, and to great educators like Graham Hutton, Bartosz Milewski, and others, FP finally has a voice.

We now understand that:

  • A Functor is like the good old Array, a way to map a function over a structure without touching its shape — a container-aware transformation
  • An Applicative allows combining multiple independent computations in a controlled and composable way
  • A Monad is a graceful way to organize effects without breaking composition (thank you, Bartosz Milewski) or natural order of execution (thank you, Rebecca Skinner)
  • A Monoid is an abstraction for combining things in a structured, repeatable way
  • Composition is more generally the art of connecting ideas without contaminating them
  • Category Theory offers the language to see the patterns behind patterns, unifying these concepts elegantly
  • etc.

Once intuition returns, the beauty becomes visible — and what once seemed abstract now feels natural. Perhaps obvious. Simplicity (not ease) is the ultimate complexity.


The Return of the Second Road

Two roads diverged in a wood, and I took the one less traveled by. — Robert Frost

At the turn of the 1980s, the software world chose the road of objects.

The other — the road of pure functions, strong types, and deterministic transformations — seemed too academic, too demanding.

But now, as software infrastructure underpins the planet, that second road is reappearing — stronger, more rigorous, more durable… and more accessible than ever.

Modern languages — Scala, F#, OCaml, Elm, Rust, Kotlin, even TypeScript — are quietly rediscovering the principles first forged in Glasgow. Not only first-class citizenship for functions. It's not only about mere functions. It's about a vast variety of techniques, of abstractions, of approaches.

Functional programming, once niche, is becoming the natural language of parallelism, reactive architectures, and formal verification.

It marks the return of structure after potential chaos, of scientific craftsmanship - whose culture is preserved, but is taken a step further, on a theoretical level (and that is the greatest honor one can bestow upon it).


FP, Structure, and the Rise of AI

In this new landscape, another force joins the stage: Artificial Intelligence.

AI models — built on statistics, inference, and data transformation - thrive on structured, predictable, semantically stable languages.

AI copilots love FP languages. Because they also love our hidden text structures. They are trained for that. It is all about how the world is seen by the humain brain. AI is better when it deals with our own vision (in any case, for the moment).

And how can we be surprised? FP develops a playground derived from epistemological studies, whose mission is to reflect our unconscious scientific thinking. If AI is trained on our discursive productions, on our materialized thoughts, it is not surprising that it appreciates the abstract language of these thoughts and recognizes many patterns in it.

They prefer logical purity to syntactic improvisation, type discipline to the messiness of mutable state.

In other words, FP speaks the language machines understand best: the language of structure and consistency. Not that everything disappears, far from it. Mutability continues to exist, for example, but it is announced as such in the code.


Conclusion

Perhaps we are now living through a new Digital Enlightenment.

And perhaps, as in the 18th century, the future will once again come from Scotland — not through the pens of philosophers, but through the compilers of programmers.

Because functional programming is not just a technical discipline.

It is a philosophy of thought, a promise of intellectual clarity. From there, it is only a short step to OOP being left behind by its practitioners, even the most experienced.

Personally, I would like to thank OOP for 10 years of good company, and I don't think I will be cutting ties completely. However, I must admit that I really enjoy coding in FP, and that the breadth of what I have learned, beyond the specificities of any particular language, brings me a sense of relief and gratitude that I haven't felt in several years.

No one is obliged to do so, of course. But it does say something about OOP, about a paradigm that has been so widely accepted, for so long. This says something about the long history of computer science, which is sometimes lost sight of, under the weight of the daily contingencies of a developer's life. Nothing is ever written in stone, and history is a living thing that can change its mind.

It took decades for the turtle to reveal itself for what it truly is: a cosmonaut who loves our humanity and our thinking. Whose time has come. Tick tock.

It envisions a world where code is not only written to work, but to be understood, modular, verified, and transmitted — a world where software becomes a language of human reason, as rigorous as mathematics, as universal as logic.

This is no longer limited to the wonders of mischief, research, or curiosity. As I explained in one of my previous articles, even one of the most widely used languages in the world, JavaScript, can now be used through the prism of FP.

And perhaps Haskell and Glasgow, for our century, will play the same role Hume and Smith played for theirs: the pioneers of a new computing rationality, shared and visible to all. ✨


Top comments (0)