Last Saturday the Guardian had a review of The Serpent Papers by Jessica Cornwell (granddaughter of John Le Carré). Set in Barcelona and Mallorca, the book is a murder mystery and more; its presiding genius is Ramon Llull, the mediaeval Mallorcan who was described by Donald Knuth as “an energetic and quixotic Catalan poet, novelist, encyclopedist, educator, mystic and missionary” (in his article “Two thousand years of combinatorics” in Combinatorics Ancient and Modern).

If you read The Da Vinci Code, you may remember the absurd claim by Dan Brown that public-key cryptography was invented by Leonardo Da Vinci. Well, in Gwyneth Jones’ review of The Serpent Papers, she almost claims that Ramon Llull invented programming languages! She actually describes Llull’s Ars Magna as “a form of algebraic logic expressed in complex diagrams (an ancient forerunner of all programming languages, by the way)”. I haven’t read the book, so I don’t know whether this notion is in it or not.

So I checked on Wikipedia, and found this: “Some computer scientists have adopted Llull as a sort of founding father, claiming that his system of logic was the beginning of information science,” an altogether more modest claim.

So what did Llull do? This is how it seems to me, but I disclaim any expertise on Llull. He was interested in combinatorics, without a doubt. Knuth describes a chapter of his Ars Compendiosa Inveniendi Veritatem which begins by enumerating sixteen attributes of God: goodness, greatness, eternity, power, wisdom, love, virtue, truth, glory, perfection, justice, generosity, mercy, humility, sovereignty, and patience. Then Llull takes each of the 120 combinations of two of these attributes, and writes a short essay on their relationship.

There is much more along the same lines in Llull’s extensive writing. But, perhaps more significantly, he invented mechanical gadgetry for generating all the combinations. His works are full of beautiful diagrams of complete graphs, rotating discs, and so forth.

He seems to have believed that any moral question could be settled by analysis of all possible combinations of attributes, virtues and vices, etc. I am not quite sure how. Neither am I sure where the logic or computer programming comes in.

There was much more to Llull than this. Before his conversion, he was a secular writer and troubador; he wrote the first novel in Catalan (which is possibly the first European novel). Afterwards he set out to convince Jews and Muslims of the truth of Christianity by rational argument (a hopeless quest, you might think – but he always believed in discussion rather than violence). His works also include Latin squares.

I will leave the last word to Jorge Luis Borges:

At the end of the thirteenth century, Raymond Lully was prepared to solve all arcana by means of an apparatus of concentric, revolving disks of different sizes, divided into sectors with Latin words; John Stuart Mill, at the beginning of the nineteenth, feared that some day the number of musical combinations would be exhausted and there would be no place in the future for indefinite Webers and Mozarts; Kurd Lasswitz, at the end of the nineteenth, toyed with the staggering fantasy of a universal library which would register all the variations of the twenty-odd orthographical symbols, in other words, all that it is given to express in all languages. Lully’s machine, Mill’s fear and Lasswitz’s chaotic library can be the subject of jokes, but they exaggerate a propensity which is common: making metaphysics and the arts into a kind of play with combinations.