It is well known that the British colonised other nations solely to ensure every child would have to by-heart Joyce Kilmer’s poem Trees and its opening verse:
I think that I shall never see
A poem lovely as a tree.
The Bombay Literary Magazine has no quarrel with trees. Indeed, as a digital magazine, we are more than merely tree-neutral; we are pro-tree. But since we are this digital thing, wouldn’t it be more honest to say that we are actually pro-algorithm? Digital magazines are just epiphytes on a vast canopy of algorithm-breathing matter. And there is no doubt that the introduction —colonisation is too strong a word— of algorithms into our world on so universal a scale has been a mixed blessing. But if we can’t be all good in our principles, perhaps we may still reach for beauty in our propositions. In the latest Crow & Colophon issue, Aditya Athalye, TBLM’s God of Code (retd.), considers such a proposition: can an algorithm be thought of as beautiful in much the same way we admit a poem to be beautiful?
Before we leave you to the mud and mirth of this question, we take a moment to celebrate couple of “good happenings”.
We're pleased to report that the work of our editors and contributors have been archived yet again in the 2023 edition of the Yearbook of Indian Poetry in English, edited by Vinita Agrawal and Sukrita Paul Kumar. Specifically, we refer to Bhaswati Ghosh’s ‘Wrapping Love’ (Issue 55), Feby Josephs’ ‘The Second Kiss’ (Issue 54) and Saranya Subramaniam's poem 'Navratri on the Muni' (Issue 54). This edition also features poems by our editors Pervin Saket, Siddharth Dasgupta, Mani Rao, Soni Somarajan and Kinjal Sethia.
There are anthologies and anthologies, but the Yearbook is the subcontinent’s first consistent, democratic, annual endeavour to archive selected Indian poetry in English. The entries are either nominated by editors of Indian magazines or received via an open call; all are anonymised before evaluation. Other poetry anthologies tend to be one-off projects or have a significant number of by-invitation contributions. For these reasons, the Yearbook has a special resonance for us.
The other good news is that Sayari Debnath, whose translation of Jayanta Dey's Bangla short story appeared in Issue 55, has been shortlisted for the Armory Square Translation Prize (2024).
Congratulations plus two coconuts for all! Onwards to Aditya and his strange question.
Colophon: Is there an algorithm as beautiful as a poem?
ADITYA ATHALYE
A recent conversation prompted me to mull the titular question, among others.
To mull is to seek meaning.
What is "algorithm"?
What is "beautiful"?
What is "poem"?
The second easiest part of this mulling is to describe “algorithm”.
An algorithm is a concrete, unambiguous, formally-written collection of steps, choices, occasional back-tracks which takes us from a from to a to. Its work must be doable in a reasonable amount of time without unreasonable expense. It must be written in precise language using clearly specified terms. An algorithm is about doing a thing, exactly the same way, again and again. The winning feature of which process is to deliver a total lack of surprise the second, third, and nth time over, forever.
Are Sisyphean endeavours beautiful? Can repeating verse over and over again create a state of beauty?
An algorithm may be performed by that app on your mobile phone, an assembly of old-school vacuum tubes and diodes, a mechanical device, the ticket clerk at the train ticket window, the Corvid that wants the treat at the end of the test the researchers have set for it.
Would changing the performer mar the beauty of a beautiful algorithm? Or a lovely poem?
At its mechanistic core, The Algorithm feeds on information. Sometimes it leads down a straight path. Sometimes it poses dilemmas like the one R. Frost mulled over in The Road Not Taken. Or trilemmas and other kinds of polyamourous conundrums. Following one always causes some action (or some inaction) to occur. Performing it always consumes energy. Once it is done, the universe has changed, certainly, if imperceptibly.
Can we dissociate algorithmic effect from algorithmic beauty? Have verses pulled at the heart strings and yet moved millions to murder?
An algorithm can be dead simple, like the steps to make dip-tea on that long-haul train or airplane ride, or can be elaborate and deeply context sensitive like making tea ceremonially in Japan. A ten year affair to learn. A lifetime to master. Some algorithms produce the same answer if you feed them the same inputs, and follow the same steps. Others are suffused with chance (probability) and iffy-ness (randomness). Yet others depend on the state of being of Schrodinger's Cat (Quantum computers), which I am told only a PhD in some esoteric branch of theoretical Physics might begin to comprehend.
Is the simple more, or less, beautiful than the involved or baroque? Objectively so? Always?
Like a poem, an algorithm can remain inscrutable for one's entire life. For many entire lives across many entire societies. One sees it in use all over the place. One knows it more or less works. One does not know exactly how or why.
Does not knowing the how or the why occlude or enhance the beauty of an algorithm? A poem?
Algorithms join other algorithms to become still greater algorithms. At some point the lines blur between mindless mechanism and sentient entity. Artifice or Artificial Intelligence? Human or mimic? Hard to tell.
Charlie Stross compellingly sketches out why the modern corporation is a "Slow A.I.". Maybe you have heard of ChatGPT and its eerily intellect-like AI brethren? Capable of generating prose, poetry, music, artwork, and video that surprise and awe. These are wrought of mathematical procedures layered on mathematical procedures. Individually mechanical, compositely almost sentient in their delights and their foibles. When prompted the same way, they will never answer quite the same way twice. Nor will they hallucinate exactly the same waking dream again. Nor are they guaranteed to be factually correct the second time, if they have managed to be correct once.
More viscerally, your motor vehicle and you are rightfully a collection of algorithms (timing, braking, steering, veering…) wrought of cheap aluminium, cheap steel, and cheap composites puppeteered by cheap little computers embedded all through its body, the lot of which is coaxed about by a squishy mess of a human being behind the wheel. This gallimaufry of mechanical, computational, and biological algorithms is usually successful, or at least tolerant of minor mishaps on the way to future successes.
What of the beauty of anthologies of beautiful and plain and gnarly and messy algorithms? Of poems? What of whole bodies of work? Entire classes and genres?
This preamble brings us to the easiest part of mulling this question, viz. entirely side-stepping a similar exposition on the subject of beauty itself. It makes me ill to think of the oceans of ink, tears, pigment, donkey's milk, and collective lifeblood of various beings that have been spilled over questions about, quests for, and quarrels over beauty. So all I will say on the subject is, your beauty means whatever it means to you.
Consider the question of algorithmic or poetic beauty by posing questions to yourself.
Do you get lost in the visual art hallucinated by the AI? Does it turn you on to see a silver gray Aston Martin streak down an autobahn? Do you delight in the infinite joy of a hearty cup of tea made the same way every day by the roadside chaiwalla outside your office complex? Does it warm the cockles of your heart when your algorithm written in computer code runs without error, with precision, with great economy? Do you occasion to smile at the shape of said code rendered on your 4K monitor—just how it appears as an abstract tapestry of characters, totally divorced from what it says or what it does?
When does a poem become beautiful? To whom? Why? Does its beauty wax and wane? Does it inspire awe and wonder in all souls that touch it? Do they feel what they feel because they have arrived there their own way, or been told to? Like The Road Not Taken? And couldn't an algorithm be more beautiful than a beautiful poem?
Remember the dip-tea? Maybe that hastily-made cuppa stirs your soul more than the deliberate ceremony you experienced after you got there? Or is it the aching memory of what that whole trip to Japan meant?
Feel her breath on the nape of your neck.
Her lips are half parted.
It escapes them.
Shiver.
Run your fingernails down the small of her back.
Slowly.
Taste her salty right cheek.
It is your last night together.
It may be your last forever.
Was it a tear?
Is this poetry? Is it an algorithm? Is it beautiful? Horrific? As what? The one or the other or both? Don't try. It's a set-up. Nonsense verse my brain spouted on a whim because it wanted an example, because my poor heart cannot bear hurting real algorithms or real poetry or real copyright holders.
You see, I am a programmer, not a poet. Still, humour me. If it were real, then to even begin to answer these we have to talk about what the words mean, why they are placed the way they are, whether they follow the rules we expect them to follow, if they produce the effect we want them to produce.
Gerald Jay Sussman, programmer and computer scientist extraordinaire, has this to say in his recent talk Programming is (should be) fun! (August 2022). Says he, at 6min 52sec in the video recording.
What does it feel like to be a programmer?
That's a really interesting question. And what I've decided to do is ask an expert in programming people.
Poets are people who program other people to have emotional reactions that they want the person to have.
Sussman then quotes Edgar Allen Poe on how he wrote his poem Raven to elicit sadness about a lost love. Boy do I relate to Poe's description of what goes on behind the scenes, between the ears.
Quality poetic and algorithmic arrangements are exacting for the same reasons.
What of literature at large? Why isn't code literature?
Could we consider some kinds of code to be so beautiful, they connect us with that intangible: the human condition? Donald Knuth refers to this question in his paper on Literate Programming:
I believe that the time is ripe for significantly better documentation of programs, and that we can best achieve this by considering programs to be works of literature. Hence, my title: 'Literate Programming'.
Should he have said "literary programming"?
I feel a tension with Knuth's idea of Literate Programming. To understand a program—its meaning, intent, behaviour, subtleties—I, the programmer, may need to view the program in several different ways.
As a coherent beginning to end narrative that Literate Programming aims to deliver.
As a network of interconnected pieces that the code actually is, in its essential form.
As the set of abstract concepts and ideas expressed through the code.
As an evolving interpretation of the unstated intent and unwritten assumptions of the author(s) of the software. Is the original narrator reliable?
And, crucially, by deliberately rewriting and re-running parts of the program in one's own words to learn about its behaviour. Breaking and remaking the narrative, as it were, by trial and error.
Nobody outside of a writing class might rewrite literature other people wrote, because it makes no sense to desecrate a finished tale by someone else. Whereas, software practically begs rewrites. It must evolve to stay relevant to demands we place on it. It is the becoming of the Ship of Theseus, not the tale of how it came to be.
In that sense, I don't think software fits the well-established mould of finished literature. It will, however, feel right at home amid the scribbled-over yellow pads and paraphernalia on writerly desks. The waste basket next to it, failing to contain crumpled rejects. And the increasingly agitated unanswered texts from the editor about the many missed deadlines.
While writing this post, a Hacker News discussion brought to my attention Vladimir Nabokov's book Pale Fire. The structure of which book sounds awfully like Knuth's Literate Programming. Delightfully, both Knuth and Nabokov shared an enjoyment of Word Ladders, which Nabokov alluded to in Pale Fire. I felt compelled to insert this random trivia. The fundamental interconnectedness of all things unfailingly delivers more, the more we look.
To quote Wikipedia's page on Pale Fire:
Pale Fire is a 1962 novel by Vladimir Nabokov. The novel is presented as a 999-line poem titled "Pale Fire", written by the fictional poet John Shade, with a foreword, lengthy commentary and index written by Shade's neighbor and academic colleague, Charles Kinbote.
…
Pale Fire's unusual structure has attracted much attention, and it is often cited as an important example of metafiction,[4][5] as well as an analog precursor to hypertext fiction, and a poioumenon.[6] It has spawned a wide variety of interpretations and a large body of written criticism, which literary scholar Pekka Tammi [fi] estimated in 1995 as more than 80 studies.
Here is a literate program authored by Donald Knuth, designed to find the most common words in a given text. Here is Nabokov’s Pale Fire. Both tell stories about, and are inexorably intertwined with the fabric of the essential text; viz. the code and the poem. Both are dense reads in their entirety. So are their literary critiques. Yet both have a compact, complete, self-contained core; the program and the poem. I can use Knuth's program without reading its exposition. I can hear Pale Fire spoken to me, without the intervention of the unreliable narrator.
Must code be read to perceive its beauty? Must it be crafted as an illustrated and annotated seamless whole? Or must it be experienced?
Does the solitary reading of a play inscribed in a dead tree book tell a self anything about what a performance of it will do to them? What many viewings of the same rendition will do to them? What viewings of different interpretations will do to them? How will it be for you, as a motion picture? Or as a story told by a silken voiced actor, sitting alone on a stage, in a pool of light, surrounded by total darkness and several other warm bodies like you, in hushed silence?
Does the text of a play dictate how it works? How it ought to be performed? Where the pauses ought to be? Where the music should begin? Whether music should even feature? And if yes, should it be a string quartet or a symphony or the sound of the sea behind the open stage?
Is any one interpretation of the text the authoritative interpretation? Is any one arrangement the authoritative arrangement? Is any one performance the authoritative performance?
Today, algorithms perform for us every day, all the time. All software exists as computer code. Code is reified algorithms.
Your Instagram and your TikTok and your Whatsapp sitting on your phone are each reams and reams of code. Each a veritable compendium of algorithms, meant to perform on that stage nestled in the palm of your hand. Each written and rewritten by hundreds of co-authors. There is so much of each that most of each pile of code is completely foreign and inscrutable to each author.
Can one even begin to conceive of the beauty of a thing one cannot even begin to fathom in its entirety? And yet. Does your Instagram connect you with the human condition? Your TikTok? Whatsapp? Does it not do the same to the co-authors of those apps?
We haven't even asked these questions of the even greater swaths of code that run within "servers". Those distant, unseen computers without which the Instagram on your phone would be as alive and well as your Imagination would, after a bottle of strong Whiskey. No likes would register, no DMs would buzz your bosom, and you wouldn't be able to follow anyone. Now there's a very human condition for you.
Maybe it is enough to know that an astonishing thing is possible; that someone made it, like the 128 language Quine relay. Or War and Peace. I have not read the Quine's code. Nor have I read Tolstoy. Mere awareness of the excruciatingly exacting syntactic rules governing computer code makes me pause and admire the madness that brought forth the Quine. Likewise the thought that our friend Leo wrote nine drafts of his book by hand, probably using a quill pen. Imagine the number of times his hand ferried ink from well to paper.
Before I conclude, a segue. I rooted about the Internet to fetch a smattering of what programmers and computing veterans have, over the decades, said about the art, beauty, and poetry of code and of computer programming.
A plaque in Silicon Valley's Computer History Museum enshrines this remark Knuth made in 1974.
Computer Programming is an art, because it applies accumulated knowledge to the world, because it requires skill and ingenuity, and especially because it produces objects of beauty.
Frederick P. Brooks Jr. likened programmers to poets in his evergreen book The Mythical Man Month (1975).
The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination. Few media of creation are so flexible, so easy to polish and rework, so readily capable of realizing grand conceptual structures.
The legendary Computer Science book The Structure and Interpretation of Computer Programs (1984) introduces the subject this way, earnestly.
A computational process is indeed much like a sorcerer’s idea of a spirit. It cannot be seen or touched. It is not composed of matter at all. However, it is very real. It can perform intellectual work. It can answer questions. It can affect the world by disbursing money at a bank or by controlling a robot arm in a factory. The programs we use to conjure processes are like a sorcerer’s spells. They are carefully composed from symbolic expressions in arcane and esoteric programming languages that prescribe the tasks we want our processes to perform.
Variously…
Matt Mullenweg, developer of now 21 year old Wordpress, coined the phrase "Code is poetry". It has forever adorned the footer of Wordpress.org's website (scroll to the bottom of the page). Their codex lists "Code is poetry" as the first philosophy. It is simply declared. Self-evident. What it means is for us to decide.
Renowned Silicon Valley venture investor and longtime hacker, Paul Graham, wrote an essay in 2003 about how Hackers and Painters are alike. By 2004, he had expanded that essay into a whole book.
Dylan Beattie's brilliant talk The Art of Code, perhaps my most favourite talk ever, looks at the origins and evolution of programming as an art form.
The Internet sent me to this piece in The Paris Review, which informed me that Vikram Chandra wrote a book Geek Sublime: The Beauty of Code, the Code of Beauty.
Following any of these threads about the magic, art, craft, and imagination of code will certainly compel us to consider the subject of its beauty, and that of the algorithms within. Ink—old-style and digital—has clearly been spilled on the subject. Albeit, nearly not as much as on beauty itself. Bloodshed is another matter. The millennia-old field of algorithms has morphed into our not-even-centenarian field of computers; a mere newborn, eyes still closed, in the saga of the human condition. They are united not only by shared blood, but that of others spilled for and due to them. Increasingly so, as they permeate all of humanity's projects, projectiles, and pogroms, materialised as computer code. When it comes to that kind of thing, even one spill is one too many.
Yet here we are.
Algorithms, to me, are at once a magical and a terrible beauty.
——
Aditya Athalye dreams in cycles of eval/apply (don’t ask (or if you do, fall into this rabbit hole for details)). Among a great many other things, he manages to pass off as a programmer, pass out mid-paragraph, pass the salt when asked to, and is tolerated by friends as a passable Human General Intelligence life form.
This implementation of Conway’s Game of Life is one of the most beautiful programs he has seen. The algorithm is written in Dyalog APL, a symbolic programming language.
life←{ ↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵ }
You can watch it unfold here.
ACKNOWLEDGEMENTS:
Banner: The image is a close up of a Jacquard loom, the automated weaving machine, whose operation had fired the neurons in Ada Lovelace’s brain, forming the ideas that guided her hands to scribble this beautiful sentence we find in her Notes:
“The Analytical Engine weaves algebraic patterns, just as the Jacquard loom weaves flowers and leaves.”
The French weavers of the era (1805) thought the loom neither beautiful nor any good. They threw their shoes (sabots) into the machines, breaking the threads and temporarily disabling the weaving of a new age. Hence, “saboteur”.
Thanks for reading Crow & Colophon! Subscribe for free to receive updates about The Bombay Literary Magazine and notes of a literary persuasion.