The Moral Algorithm
We tend to think of morality as a kind of compass. Some possible worlds are better than others—more just, less painful, more full of flourishing—and morality, on this view, is what points us toward those better worlds, or what we use to measure how close to them we are.
Sam Harris made this case in The Moral Landscape, grounding moral judgment in the intuition that a world of maximum suffering for every conscious being would be obviously “worse” than the one we inhabit.
Derek Parfit explored the same terrain with greater ambivalence in Reasons and Persons, asking whether a world of near-infinite barely-satisfied souls could be “better” than a much smaller world of genuinely thriving ones. He called this the Repugnant Conclusion, and intended it as a challenge to any simple formula for moral arithmetic.
Both thinkers shared the same basic assumption: that morality has a direction. That it points somewhere.
Maybe it doesn’t. Maybe morality is less like a compass and more like an algorithm—a set of processes that respond to inputs and generate outputs, without a preset destination.
Consider the forces we know in nature. Gravity, electromagnetism, the strong and weak nuclear forces—none of these is trying to achieve anything. They operate according to their nature, and from that operation emerges everything from the warmth of a candle flame to the spin of galaxies. They do not point toward a particular end state. They simply work.
What if morality works the same way? We might think of its components as something like moral forces: the impulse to reduce suffering, the drive to preserve life, the pull toward connection and reciprocity, the thirst for justice, the yearning for forgiveness. Each operates at its own scale and with its own strength—much as the strong nuclear force dominates at subatomic distances while gravity governs at cosmic ones. The aversion to causing immediate, visible pain may be overwhelming in the presence of someone suffering in front of us; the broader love for all of humankind may be quieter and more diffuse, but no less real. These would be the algorithm’s inputs: tweak their values—more suffering here, weaker bonds of reciprocity there—and the output (our sense of what is “right” in a given situation) shifts accordingly.
And just as the forces of nature have no effect without matter and energy to act upon, morality too requires a substrate. Software without a runtime is dead code; morality without conscious beings is the same—inert, directionless, waiting.
Viewed this way, the thought experiments of Harris and Parfit look less like logical puzzles and more like artificial physical configurations, the kind you get when you press two magnets together north-to-north. Such states don’t arise naturally. But understanding how the forces work lets us predict what happens if they do: the magnets repel each other and spring apart the moment you let go. A world of maximal suffering might drive its conscious beings, at every level, to end that suffering. A world of barely-living multitudes might see them urgently compelled toward finding a better life, disinterested in reproduction. Or something else—it would depend on the tuning of the algorithm’s parameters, which we may not be able to precisely measure.
To be clear, I am not making a bold claim about what morality fundamentally is. It may be something else entirely—divine, emergent, illusory. But thinking of it as an algorithm rather than a compass offers, to me, a way around some of the seemingly impossible questions on the subject. As with any change of lens, it may not reveal the ultimate truth (as every lens bends the light), but it can bring into focus something that was previously unclear.