Confucius and the Programming Language of Power

How the sage connects to Computer Science today

From Confucius, Philosopher of the Chinese, 1687

Kongzi (Confucius) goes on and on about ritual. When to bow, how to sit, what kind of inner and outer coffin to use. It seems pointless.

I truly did not understand what Kongzi meant when he said “One governs a state by means of ritual” until I looked at the state I’m in. Are we so different?

What is the signing of a bill, the exchange of wedding rings, the Oscars? These are all rituals. We still use ritual to define our social order. That’s why we still have inauguration ceremonies and wear wigs in court. Our ritual only invisible to us because we’re swimming in it.

Ritual is still governs how people interact with each other and how rulers command us.

Ritual is the programming language of power, writ upon the people and the ministers of state. Hence Kongzi’s lessons still apply today. What Kongzi taught was how to learn this Matrix, how to understand it and — ultimately — how to command.

Kongzi don’t get no respect

Like any prophet in his own time, Kongzi was without honor in his own land. He was always talking about government, but never running one.

13.10 The Master said, “ ‘If someone would simply employ me, within a single year I could put things into some kind of order, and within three years the transformation would be complete.”

It never happened. Kongzi was never more than a minor official and lived a largely itinerant life. When asked what he would do, given the chance, this is how Master Kong responded:

I have highlighted his sick burns of Zilu throughout the Analects, but am referring the other part here

WTF? The first thing he’d do would be to correct names? For example, he says that a King would never borrow a horse from a lord, he would take it. This, to Kongzi, was the most pressing matter of state.

But why?

Programming languages

This made no sense to me until I thought of it as a programming language. The first thing I learned in Java was declaring methods, which is essentially naming things. public static void main why? I’m just trying to print something. But these names all matter. Without the right language, nothing compiles.

Such is the power of state language. If a leader does not use words reliably or correctly, his lords won’t. If his lords don’t speak accurately, the people will be confused. Disorder will be the language of the realm. Nothing will compile. Runtime errors ensue. The kingdom crashes.

In such context, Kongzi’s obsession with ritual makes sense. Bowing, giving gifts, mourning the dead — these are the classes, objects, and methods of power. This is how social hierarchies are defined, how arguments are passed, how emotions are processed. It’s the literal command line.

In this sense, the government of a state is like a giant computer program, running on ritual code, stored on human computers. In The Three Body Problem and Invisible Planets, Cixin Liu describes a literal human computer — an army aligned with flags to make bits and logic gates and run computer programs, in the flesh.

Here is a scene where one particular logic gate, made of three soldiers, malfunctions:

A few riders dashed into the phalanx with their swords drawn. They killed the three unfortunate soldiers and replaced them with new men. From the vantage point of the dais, three eye-catching pools of blood appeared in the middle of the central processing subformation. 
Jing Ke gave the order to restart the system. This time, it went very smoothly. Ten minutes later, the soldiers were carrying out the circular-ratio-calculating procedure. As the phalanx rippled with flag signals, the calculating formation settled into the long computation. 
“This is really interesting,” King Zheng said, pointing to the spectacular sight. “Each individual’s behavior is so simple, yet together, they can produce such complex intelligence.” 
“Great King, this is just the mechanical operation of a machine, not intelligence. Each of these lowly individuals is just a zero. Only when someone like you is added to the front as a one is the whole endowed with meaning.” Jing Ke’s smile was ingratiating.
Invisible Planets (p. 314)

This is a fictional example, used to make a literal program that runs calculus. But government is also an algorithm, solving problems using rules. The rules are the rites. This is why ritual propriety was so central to Kongzi’s teachings. His admonitions were so deceptively simple that people kept asking if there was more.

For example, this is his idea of an ideal ruler:

This is confusing. A great king just faces south and sits down? The other disciples asked Kongzi’s son Boyu if they were missing something.

16.13 Ziqin asked Boyu, “Have you acquired any esoteric learning?”
Boyu replied, “I have not. My father was once standing by himself in the courtyard and, as I hurried by with quickened steps, he asked, ‘Have you learned the Odes?’ I replied, ‘Not yet.’ He said, ‘If you do not learn the Odes, you will lack the means to speak.’ I then retired and learned the Odes.
“On another day, my father was once again standing by himself in the courtyard and, as I hurried by with quickened steps, he asked, ‘Have you learned ritual?’ I replied, ‘Not yet.’ He said, ‘If you do not learn ritual, you will lack the means to take your place.’ I then retired and learned ritual. “These two things are what I have been taught.”

This is the height of Confucian learning. He said “If for one day you managed to restrain yourself and return to the rites, in this way you could lead the entire world back to Goodness.” This is what he told Boyu, who told his son Zisi, who told Mengzi; these teachings then became the basis of the Chinese civil service exam. These words were memorized by the entire governing class for over 1,200 years. These ancient words and rituals became the programming language of Chinese imperial power for centuries.

This is the programming of power. Encoded in every administrator, compiled in the hearts of the people, waiting for a Son of Heaven with root access to take up the command line, and make the whole system run.


Please not that this is not a distillation of Kongzi’s thought. You should read it directly. I highly recommend the translation and commentaries linked below. This is simply how I went from understanding ritual as something superstitious and dumb to something super serious and still relevant today.

Highly recommended:
CONFUCIUS. Analects: With Selections from Traditional Commentaries (Translated & Annotated) (Hackett Classics). (via Five Books)