A Code-Obsessed Novelist Builds a Writing Bot. The Plot Thickens

Vikram Chandra, the author of Sacred Games, created Granthika to keep track of complex narratives. It could change the future of storytelling.
Vikram Chandra sitting in his backyard
“I need a word processor that does more than word processing,” Chandra says.Photograph: Nina Riggio

In the first episode of the Netflix adaptation of Vikram Chandra’s best-selling novel, Sacred Games, the criminal kingpin Ganesh Gaitonde makes a phone call to a detective, Sartaj Singh.

“I want to tell you a story,” Gaitonde says.

And off we go, launched into an intoxicating tale of gangster drama, loaded with sex and politics and religion and history, punctuated with Bollywood songs and the tantalizing mélange of half a dozen languages. Gaitonde’s story drives the plot, but a welter of other narratives intersect and circle around each other, clash and complement.

For those familiar with Chandra’s work, the upfront declaration—I want to tell you a story—is a multimedia calling card. As a teacher of creative writing at UC Berkeley, as an executive producer of the Netflix series, and as the cofounder of a startup that makes storytelling software, Chandra is literally in the business of narrative. There’s hardly a dividing line between his life and art: He weaves yarns and so do his characters.

His first novel, Red Earth and Pouring Rain, is a tangle of nested tales that starts with a monkey in Bombay pounding away on a typewriter, spinning out an epic that contains a hall-of-mirrors refraction of other storytellers telling stories. Each of the five pieces in his collection Love and Longing in Bombay begins with an audience listening to a story. His well-received 2013 venture into nonfiction, Geek Sublime: The Beauty of Code, the Code of Beauty, is part memoir, part how-to—a deep-dive investigation of the creative act as expressed in the arts of programming, literature, and ancient Indian philosophy.

A native of India, the 58-year-old Chandra supported himself as a graduate student studying creative writing in the United States by working as a programmer. He is as comfortable with code as he is with prose, and his startup, Granthika, is a geekily sublime merger of both sides of his brain. The premise is at once simple and almost impossibly ambitious: Chandra believes that we have yet to fully exploit the power of the computer to enhance and facilitate the creative process. Using Granthika, Chandra says, writers can dispense with the grunt work that distracts them from focusing on the good stuff—the story!

“I want to get rid of the grinding,” Chandra says, borrowing a term from gaming jargon that describes the repetitive gameplay necessary for leveling up. Granthika is designed to help writers keep track of character attributes, timelines, the who-what-when-where of their tangled plots. Granthika intends to simplify the act of engaging with complexity.

The history of writers screwing up crucial details of their own stories dates all the way back to Homer. (Even Homer nods!) As a cautionary tale, Chandra, a huge Sherlock Holmes fan, likes to cite the example of Arthur Conan Doyle, who routinely committed such goof-ups as giving Dr. Watson two different first names. Chandra, by his own admission, can’t abide the thought of even the smallest continuity errors or internal contradictions in his own work. From practically the beginning of his love affair with computers, Chandra has lusted after a word processor that will keep him from making inadvertent mistakes. So he built one.

But that’s just the beginning. Chandra’s novels and stories seek to grapple with the entirety of India’s place in the world, from its ancient myths and aesthetic discourse to its disastrous experience with colonialism to its modern kaleidoscope of bedazzling—and politically destabilizing—ethnic and linguistic and religious division. He is nothing if not a big game hunter.

His greater vision for Granthika is as a tool for building what he describes as “a rule set” for complex fictional or nonfictional universes. Once built, that rule set can then be shared with others, opened up for exploration, adoption, and adaptation by multiple collaborators or fan fiction writers or gamers.

Granthika may not be for everyone. There are likely plenty of novelists whose literary aspirations don't involve elaborate world-building. There's no getting around it: Chandra's software is designed to help write the kind of big, complex novels that Chandra specializes in. Like many a startup entrepreneur before him, he is “scratching his own itch.” But the dream is still seductive: With Granthika watching from on high, guarding the internal coherence and integrity of any given universe, writers will be free to tackle the grandest challenges they can envision.

A collection of photos, documents, and letters Vikram Chandra compiled for his novels (except for the photo at lower left, which is a family snapshot).

Photograph: Nina Riggio

The art of crafting stories was dinner-table conversation in Chandra’s childhood homes in Delhi and Bombay. His mother, Kamna Chandra, is an accomplished screenplay writer who has worked with some of Bollywood’s greatest legends. One of his younger sisters is a film writer and director, and the other is a film critic who is married to a director. Chandra’s father, now retired, was a corporate nine-to-five executive at a chemical company who happily subsidized all the creative ferment, including Chandra’s journey to America to study creative writing. (“Thank god for the corporate guy!” Chandra is fond of saying.)

Chandra describes himself as a “weird kid,” a “nerd” who was a voracious reader and constant conjurer of strange tales. He wrote his first story—an exercise in science fiction—in sixth grade. He read everything he could get his hands on, equally at home with comics, Shakespeare, and the great epics of Indian mythology, the Mahabharata and Ramayana. In high school, he fell in love with American modernists like William Faulkner and Ernest Hemingway, and eventually became convinced he had to move to the United States to fulfill his writerly calling.

As a student of both film and writing, he hop-scotched across America, from Ohio to Los Angeles to New York to Houston, before landing in Berkeley. (He currently splits his time between Bombay and California.) Along the way he managed to get graduate writing degrees at both John Hopkins University and the University of Houston while studying with two of the giants of postmodern literature, John Barth and Donald Barthelme, both of whom excelled in taking apart traditional narrative structures, mixing up the pieces, and rebuilding them in bizarre new forms.

Chandra's first novel, Red Earth and Pouring Rain, from 1995, is simultaneously a riff on the Ramayana, a retelling of the British conquest of India, and a story about a young Indian man at school in the US in the 20th century. It garnered rave reviews and the Commonwealth Writers Award for Best First Book. Chandra parlayed his out-of-the-gate success and the similarly warm reception to his 1997 collection of short stories, Love and Longing in Bombay, into a day-job career as a creative writing professor, first at George Washington University and then at UC Berkeley. With that institutional security in hand, he was able to tackle the 10-year challenge of finishing Sacred Games.

But all the while he never strayed far from the world of code. Chandra fell under the computer’s spell while studying film at Columbia University in the late 1980s, when he took a job at a firm that provided secretarial services for medical insurance companies. His job was to convert handwritten notes from doctors’ examinations into a form suitable for legal wrangling. Three months into the job, the company provided its workers with personal computers.

There is a particular kind of mind that responds to the miracle of code—the godlike power of compelling the execution of a specific task by correctly compiling a sequence of symbols together. Chandra dove in: “Here,” he wrote in Geek Sublime, “was a complete world, systems and rules I could discover and control ... there were mysteries, things I didn’t understand, but there were always answers. If I tried hard, there was always a logic to discover, an internal order and consistency that was beautiful.”

By the time Chandra reached Houston and set to work on his first novel, he was computer-proficient enough to make what he calls a “decent graduate school living—enough to afford regular trips back to India,” by providing general programming and computer consulting services. (To this day, Chandra considers himself “a working-class programmer.”)

When he started writing Sacred Games in the late ’90s, his original conception for the book was as a novella-sized gangster story sparked by his experience of hearing automatic weapons fire between rival mobs while living in Bombay. But during the course of his background research—Chandra is an avid notetaker, researcher, reporter, and fact checker who chases down every available rabbit hole with relentless ferocity (“I have a really obsessive nature,” he tells me, more than once)—he soon realized that he couldn’t tell a story about Indian gangsters without delving into police corruption and the complicity of politicians, as well as the ethnic and religious squabbling that is endemic to present-day India.

The story metastasized, growing to incorporate the devastating partition of India into Muslim-majority Pakistan and Hindu-majority India in 1947 and including sidetracks into Bollywood filmmaking, spiritual transcendence, and intelligence agency machinations—all served with heaping helpings of love, betrayal, and murder. Chandra is mild-mannered, soft-spoken, and cautiously thoughtful in person, but as an author he writes sex scenes that steam and action that pounds. When he finally finished, Sacred Games was an epic that clocked in at 947 pages, covered 60 years of modern Indian history, and featured more than a hundred characters. It commanded a reported seven-figure advance.

For a perfectionist like Chandra, the process of writing was a special kind of torture. The universe of Sacred Games was too big to hold easily in the short-term random access memory of his brain. Early on in the writing, he realized that “handling all this stuff was going to drive me crazy.” Just figuring out what a character’s age was supposed to be at any given time was a distracting, Sisyphean chore.

“Say you have a character born in 1978,” Chandra says, “and then you want that person to do something against a historical incident in 1996, but then you think, ‘Oh, but wait, this other thing that he needs to take part in happens in 2001. How do I make all of this match?’ If you change one date somewhere, then that has both a downstream effect and an upstream effect.”

As a writer, Chandra delights in multiple layers and dizzying whiplashes across space and time. But as a programmer, he is all too aware that a single parentheses out of place can break the spell. So the question became how to use the strengths of one discipline to shore up the weaknesses of the other.

“I need a word processor that does more than word processing,” Chandra says. “And I was sure somebody had written software to do this. And then I discovered that they hadn’t.”

Ganesh is the Chandra family’s favorite Hindu god.

Photograph: Nina Riggio

A carven image of Ganesha, the elephant-headed Hindu god who is known as both “the remover of obstacles” and the patron of poetry, greets visitors from the front door of the Craftsman-style home in north Oakland, just a few houses south of the Berkeley border, that Chandra shares with his wife, Melanie Abrams (also a novelist, also a creative writing teacher at Berkeley), and his two daughters.

The word granthika is a Sanskrit noun that means “narrator, relator” or “one who understands the joints or division of time.” It is closely related to another noun, grantha, which means “an artificial arrangement of words, verse, composition, treatise, literary production, book in prose or verse, text,” and the root stem granth, which means “to fasten, tie or string together, arrange, connect in a regular series, to string words together, compose (a literary work.)"

But what Granthika is really intended to be is the remover of obstacles that hinder the stringing together of an artificial arrangement of words in a harmonious, meaningful fashion. The core challenge of this goal is that it knocked heads with one of the most stubborn problems in computer science—teaching a machine to understand what words mean. The design document describing Granthika that Chandra wrote in airports and hotels while on tour for Geek Sublime called for a “reimagining of text.” But that’s easier written than done.

“I discovered that attaching knowledge to text is actually a pretty hard problem,” Chandra says.

Computer scientists have been trying to slice this Gordian knot for decades. Efforts like the Text Encoding Initiative and Semantic Web ended up loading documents with so many tags aiming to explain the purpose and function of each word that the superstructure of analysis became overwhelmingly top heavy. It was as if you were inventing an entirely new language just to translate an existing language. Software applications built on top of these systems, says Chandra, were "difficult and fragile to use."

One sleepless night, Chandra had an epiphany. He realized, he says, that the key to representing text and semantics in a way that avoided the problems of the traditional approaches lay in treating text as a “hypergraph.”

With traditional graphs, Chandra says, diverting into mathematical terrain that most of the writers who use Granthika will likely never dare enter, “you only have attachments between one node and the next and the next. But a hypergraph can point to many objects, many nodes.” A hypergraph approach would, he realized, enable a organizational system that illuminated multiple connections between people, places, and things, without getting bogged down in efforts to define the essential meaning of each element. The goal of processing a text document into a multi-nodal hypergraph of connections became Granthika’s central operating principle.

The underlying software is built on an adaptation of an open source database program called HypergraphDB, created by a Montreal-based programmer, Borislav Iordanov. Chandra first encountered Iordanov’s work when he started Googling around to see if any existing software fit the description of what he had conceived in his head. Chandra emailed Iordanov some technical questions; Iordanov responded by asking him what it was, exactly, that he wanted to do, and ended up so intrigued by Chandra’s answers that he joined the nascent project.

So how does it work, practically? In version one of Granthika, which launched in November, writers engage in a running dialogue with the software. The writer tells Granthika that so-and-so is a “character,” that such-and-such is an “event,” that this event happened at this time or at this location with this character, and so on. This becomes the rule set, the timeline, the who-what-where-when-how.

Behind the scenes, under the surface of the document, Granthika is a database of connecting links between these text objects. If, in the middle of the creative process, the writer wants to review a particular character’s trajectory, she can click on that character’s name and go directly to a timeline of all the events or scenes that that character is involved with.

“So I’m writing a novel,” Chandra says, “and I’m mentioning a character on page 416 and she is a minor character that I last mentioned on page 80. Previously, to know about that character I have to open up my note-taking program and then search through the notes. With Granthika, I can press one key stroke and go to her page, as it were, and see all my notes about her and hopefully soon pictures that I’ve attached, and so on.”

The breakthrough is that the computer doesn’t have to understand at any sentient level who the character is, it just has to know what things that character is connected to.

Creating a hypergraph database that links multiple elements in a novel like Sacred Games is a process-intensive computing task that Iordanov says wouldn’t have been possible until relatively recently. It is also a realization of what some of the earliest observers of electronic text theorized was a crucially defining aspect of computer-mediated, globally networked technology—the new ability to meaningfully link things together.

Ultimately, Iordanov says, the hope is that advances in natural language processing and semantic analysis will be incorporated into Granthika, making the program smart enough to do its own tagging. So as the writer crafts, Granthika might ask Is this a character? Is this an event? and, depending on the writer’s answers, build the rule set—the framework that binds characters and events together semiautonomously.

But Chandra cautions against thinking of Granthika as a full-fledged AI with its own independent creative capacity. The point of Granthika is to take advantage of what the computer can do and what the human being can do and bring them together. The Granthika-writer relationship is a partnership founded on the principle of mutual error-correction. The human makes the creative decisions. The computer wrangles the database of those decisions.

Vikram Chandra at his home in Oakland, California.

Photograph: Nina Riggio

In Track Changes, Matthew Kirschenbaum’s marvelous history of the word processor, we learn that the first cohort of writers to abandon typewriters and start composing with screens and keyboards consisted mostly of science fiction writers. There were some exceptions—notably, the historical fiction writer Gay Courter, who wrote her best-selling novel The Midwife on an IBM System 6 in the late 1970s—but, generally speaking, the writers whose eyes were most firmly trained on the future were the easiest to lure way from their Olivetti Letteras.

Jerry Pournelle, a science fiction author, columnist for Byte Magazine, and computer hardware and software tinkerer, was one of the most effusive early adopters. The ease with which word processors facilitated the task of revision—no more correction fluid, no more carbon copies, no more laboriously retyping an entire document over and over again—induced in him an instant writerly bliss.

Pournelle gushed about what he could do with his home-built computer, which he called Ezekial, and an early word-processing program. As recounted by Kirschenbaum, Pournelle once wrote, “Ezekial changed my life. He did most of the real work of writing. I never had to retype anything, and I could fiddle with the text until I had exactly what I wanted. Computers not only let you write faster, but by taking the mechanical work out of writing they let you write better.

The hugely popular vampire fiction writer Anne Rice went even further, Kirschenbaum says: “She said that with the word processor there is no excuse for not writing the perfect novel.”

Despite such early enthusiasm, few would argue today that the digital age ushered in the era of the “perfect novel.” Kirschenbaum says there isn’t even a consensus on whether word processing technology has led to “better” prose, on average. But there seems little doubt that word processors enabled faster writing and that there is now less mechanical work involved in the act of literary creation. “Better for [Pournelle] meant something like ‘more efficient with less bodily labor’ so that he could do more,” Kirschenbaum says. “It was about throughput and efficiency.”

In effect: less grinding. What Chandra wants from Granthika is exactly what the earliest writers who embraced word processing technology grasped as a long-desired boon. According to Kirschenbaum, when Courter was writing The Midwife, “she immediately understood that she could use the tool to do a kind of world building that featured internal consistency.”

In addition to her primary text document, she also created a searchable file for family trees and place names, and, Kirschenbaum writes, generated a “concordance that would allow a copyeditor to keep track of Yiddish, Russian, and other tricky words and phrasings.”

Gay Courter is still busy writing, and I emailed her to introduce her to Granthika.

“It intrigues me,” Courter said by email. “I tried at least one novel writing program—Scrivener—a few years ago that had some nice features, but in the end was too restrictive for me. This program seems to have some of the same tools, but looks a lot better ... I probably will try the free version for fun. I am a sucker for innovation.”

(In a followup email, Courter expressed some reservations about the $10-a-month, $100-a year subscription price of Granthika.)

I also reached out for comment on Granthika to Princeton computer scientist and author David Gelernter, who has written both novels and nonfiction books. He agreed that there was room for improvement in currently available word processing technology.

“I do need better writing tools, desperately,” Gelernter emailed. “I’m using a word processor today that could have been designed in 1991—or, as far as basic structure vs GUI [graphical user interface] goes, in 1979. Our word processors are obsolete junk ... No one has touched this topic seriously for 20 years.”

“[But] only a novelist who doesn’t know what he’s doing would want or use the kind of software you describe,” Gelernter said. “I don’t think any novelist with half a brain would touch Granthika with a 10-foot pole—I certainly wouldn’t—unless he has a special interest in experimenting with software, which is always fair enough. A novelist needs to feel the direction of the breezes, the updrafts and the mood-flows inside his characters and his plot. If he can’t ride the air currents within his own novel, he should look for another job.”

Gelernter dismissed Granthika without giving it a hands-on exploration, but several writers who were part of the Granthika beta-testing process say they found the software useful.

Anjanette Delgado met Vikram Chandra at a writer’s workshop in Miami and was immediately intrigued when she heard him discussing Granthika. A novelist, journalist, and former digital media producer for multiple television networks, Delgado sees Granthika as a “world organizer” that helped her “write a more layered story.”

“The biggest problem that writers have is they don’t realize that you have to hold a whole world in your head,” says Delgado, who teaches an annual class at the Miami Book Fair called “Finish Your Novel the TV Way.” “It gets confusing and overwhelming.”

“What Granthika does,” she says, “is create a file for everything. So when I’m looking to layer my story, I pull up something and instantly see all the context.”

“I find it helpful to visualize how many scenes are in each chapter, and keep track of scenes, characters, and events,” says Monica Sherwood, another beta tester. “I think Granthika has the most use for me when I feel I need to take a step away from the material itself and focus instead on ensuring that the foundational components of the writing are there. What I do think is unique about Granthika is the way it links text to elements of the writer’s story. It feels like there’s a certain level of intelligence there that competitors don’t employ.”

“When I wrote my second novel, Chanakya’s Chant,” says Ashwin Sanghi, a best-selling thriller writer who is often called the “Dan Brown of India,” “my lead character started out with blue eyes but had green eyes by the end of the book. It was a stupid mistake that my editor should have picked up. Granthika attempts to do precisely that.”

“The spellcheck function of a word processor is ubiquitous today and I cannot manage without it,” Sanghi says. “Maybe one day the logic check, chronology check, and fact check functions of Granthika will become just as necessary.”

I contacted Sanghi after reading a quote he’d given to another reporter expressing the hope that Granthika could facilitate greater complexity in novel writing. What did that mean?

“Think about a story revolving around three characters and three reincarnated lives,” Sanghi says. “In effect, the story involves nine different people who have karmic equations to be settled in multiple lifetimes. Granthika could actually allow me to consider something like that.”

Chandra holds floppy discs containing his first novel Red Earth and Pouring Rain, which he wrote in grad school.

Photograph: Nina Riggio

In late November, Chandra alerted me via email that Granthika had pushed out a new update with significant new functionality—“the ability to export and import the ‘universe’ of your story—its characters, locations, events, etc.”

“You can export your universe and then you or someone else can import it into another project,” wrote Chandra. “So you can work with the same fictional context within several different writing projects (a multi-novel saga, perhaps), or collaborate with someone else ... On the roadmap: automatic syncing of universes, so that a shared universe will dynamically update when a change is made anywhere.”

Chandra is convinced that the ability to export Granthika universes will find particular favor in the world of fan fiction. In his view, a writer who wanted to create her own story in the Harry Potter universe could just import the Harry Potter rule set into their Granthika processor and be magically exempt from the fear of “breaking canon”—sacrilegiously getting some major or minor detail wrong and infuriating the fans of that universe.

Anne Jamison, an English professor at the University of Utah who has written a book on fan fiction, professes herself fascinated by Granthika. But while she sees potential applications for professional genre writers who might be contractually required to write three or four books a year—“think of all those Hardy Boys writers who could have been helped by a thing like this” she says—she wasn’t entirely sure that Granthika would be a killer app for fan fiction writers.

Fan fiction writers, Jamison says, are often defined by their all-consuming knowledge of canon. That’s part of the point: They’re exhaustively obsessed with the source material. Not only wouldn’t they need any help from a predefined rule set, they are often inspired, Jamison says, by a desire to explore “what if things were done differently? How would everything change?”

They’re not afraid of getting something wrong and breaking canon, she says. Instead they’re all about “fixing canon.” Why did a favorite character have to die? Let’s have Spock and Kirk fall in love! Let’s get Harry Potter on the Enterprise.

Historically speaking, continuity mistakes in the taboo sense that Chandra views them aren’t deal-breakers for fan-fiction writers, Jamison says. To illustrate her point Jamison cites the world of Sherlock Holmes “pastiche” writing (which she defines as “what we used to call fan fiction when it was mostly men writing it.”)

There is a whole genre of so-called “Watsonians,” Jamison says, who believe that Watson was the real writer of the Sherlock Holmes stories and who have devoted their lives to coming up with explanations of Conan Doyle’s “mistakes.” The mystery writer Dorothy Sayers even wrote an entire essay definitively explaining why Dr. Watson has two different first names.

“Part of the game,” Jamison says, “in what is in fact called ‘The Game’ is interpreting these errors in such a way that the world still makes sense.”

But for Chandra, even canon-breakers still might want help from Granthika.

“Suppose there is a group of fans who want to create a Veronica Mars–meets–Batman universe, thereby violating both canons,” Chandra says. “They’re still going to want to maintain consistency in their particular fan-created universe. And that’s exactly where Granthika can help, in terms of specifying the locations, characters, timelines, etc., of their own particular universe.”

Chandra is learning Sanskrit.

Photograph: Nina Riggio

All stories have in them the seed of all other stories; any story, if continued long enough, becomes other stories, and she is no true storyteller who would keep this from you.” Then she was quiet, and I imagined stories multiplying spontaneously, springing joyously out of a mother story, already whole but never complete, then giving birth themselves, becoming as numerous as the leaves on the trees, as the galaxies in the sky, all connected, no beginning, no end, and I grew dizzy, and then she went on. Listen... —Red Earth and Pouring Rain

Three 24-inch flat-screen monitors, arranged in a segmented arc like the top of an octagon, dominate Vikram Chandra’s desk. The screen in the center is where the creative act occurs, while the screens on the left and right are for accessing the internet or programming.

Chandra’s office offers a quick introduction to his bipartite mind. (As he wrote in Geek Sublime, “Fiction has been my vocation, and code my obsession.”) It is packed with both books and gadgets—including gadgets that he uses to read his books. Chandra prefers digital text over old-fashioned hard copy. When a physical book comes into his possession, he removes the binding, runs the individual pages through a high-throughput fast scanner, and converts them into an electronically readable file. (For reasons he confesses he is unable to fully articulate, he still keeps the physical books around, straining the capacity of his office.)

To the right of the desk, a cardboard poster filled with Sanskrit words leans against the wall. Once a week, Chandra studies India’s great classical language via Skype with a tutor in India. I have come to Chandra’s office to get a look at him actually using Granthika while he writes, but the Sanskrit reading aid distracts me; it presents the perfect opportunity to ask a question that has fascinated me ever since I read Geek Sublime.

Was it possible that there was some kind of cause-and-effect link between the structure of Sanskrit and the global prowess of Indian programmers?

The argument goes like this: Of all the ancient languages in the world, Sanskrit is the most formal and regular in its structure, to the point that some modern observers have viewed it as a kind of programming language itself. Some 2,500 years ago, the Indian philosopher and philologist Panini produced a grammar for Sanskrit that not only fully described the existing language but created a way to generate new Sanskrit words, as if by algorithm. As Chandra explains in great detail in both Geek Sublime and on a long blog post on the Granthika website, Panini’s grammar ended up influencing modern linguistic theory in the West, which in turn influenced the development of high-level computing languages like FORTRAN.

In the course of pointing out the similarities between how ancient Indian philosophers regularly attempted to create a version of Sanskrit that would “formulate logical relations with scientific precision,” and what computer programmers do when they attempt to represent knowledge, Rick Briggs, a NASA specialist in artificial intelligence, even suggested it was “tempting to think of [ancient Indians] as computer scientists without the hardware.”

This has led some observers to speculate that the deep structure of Indian culture has nurtured a cultural proclivity for working with the formal hierarchies of code.

Though Chandra edges very close to making such a claim in Geek Sublime, in person he was reluctant to make a direct connection. “I am very hesitant to make a huge deterministic claim about an incredibly complex culture that’s existed for many thousands of years,” Chandra says. “The famous line about India is ‘whatever you can say about India the opposite is also true.’ What I would be willing to claim is that India is a culture in which the pursuit of knowledge has always been of primary and over-riding and huge concern, despite the destruction of those indigenous knowledge systems by colonialism and the laying waste of an incredibly rich economy, which at the beginning of the colonial period was one of the largest if not the largest in the world.”

Then what was the point, I ask, of Chandra’s voluminous Panini blog post. Because the implication that I gathered from it was that Granthika itself was also a kind of grammar, an attempt to do for creative expression what Panini had done for Sanskrit.

Chandra now seems fine making a huge claim about Indian culture. “The interesting thing about the Indian intellectual tradition and scientific tradition is that it is so grammar-based,” he says. “We’ve tended to think of everything as a kind of grammar. Whereas in the West the impulse is to use mathematics to understand the universe, in India it has always been grammar—grammar that is conceived as a system that has components that interact with each other. That’s how Panini thinks of language. You start with the smallest units, phonemes, and then you build that up into roots and nominal stems and then you combine those into words and then words combine together to make a language. And so you have not just the elements but you also have their interaction.” You have, in effect, a system for representing complexity.

Chandra’s love for India, for its hectic traffic and its linguistic Babel and its stark contradictions, is obvious in nearly every sentence he writes. It’s one of the main reasons Sacred Games grew into such a monster. He was obsessively driven to capture as much as he could of an infinitely complex reality.

That impulse led him into politically volatile ground. Chandra tells me that the second season of the Netflix Sacred Games series provoked a backlash because some viewers saw the portrayal of a key character, a Hindu guru, as a critique of India’s Hindu tradition. Under today's right-wing Hindu government, led by Narendra Modi, deviations from the party line on history or religion are punished, evincing a troubling cultural narrow-mindedness that runs counter to just about everything Chandra seeks to evoke in fiction.

“The scary part,” Chandra says, “is the unquestioning acceptance and glorification of the premodern, and also the flattening out of all the complexity that existed before. In the Indian polity there is an effort to declare that just one version of that past history is the one that is supposed to be the correct one—and everybody else who tries to introduce complexity or critiques this idea are anti-nationals, they are traitors, they are coolies of the West. That to me is in complete contradiction with the complexity and the openness of the Indian tradition.”

Listening to Chandra pivot from Sanskrit and grammar to politics and history, I suddenly remember Ashwin Sanghi’s thesis that Granthika would enable him to solve complex karmic equations. Between the lines of Chandra’s complaint about the Indian right wing’s straitjacket on historical interpretation, I heard a writer bemoaning the inability of people to grasp the true complexity of the world, or even be allowed to represent it. (I also heard a writer all too accurately anticipating the political conflagration in India incited by the Muslim-excluding Citizenship Act passed in December.)

And I began to see Granthika as more than just a tool to eliminate grinding. It is also, ideally, a tool that could enable writers to grapple more deftly with the infinite, with all “the galaxies in the sky all connected, no beginning, no end.” Or at the very least, it’s a statement of purpose: This is what we should be using computers to do.

The fifth-century Indian philosopher Bhartrhari, Chandra tells me, wrote that “grammar is the door to liberation.”

“Which sounds completely crazy,” Chandra says. “What does that even mean? But what he is trying to get at is that for any system, such as the system of life and death and rebirth, if you can understand its parts and understand how it works, then you can escape it.”

Granthika, then, is a grammar for the liberation of writers. It is meant to free us from the shackles inhibiting us from getting on with the important, hard stuff: the task of representing the world in all its breathtaking, multifarious complexity. At a time when the planet is overrun by authoritarians attempting to impose narrow dogmas, it’s hard to think of much that could be more important.

At one point in Red Earth and Pouring Rain, the monkey god Hanuman is asked, “What is the highest pleasure?”

“To hear a good story,” he answers.

If Vikram Chandra succeeds in scratching his itch to, as he puts it, lessen his own “damn cognitive load and make it bit easier to understand his own narrative thinking,” then it’s a good bet that there will be more good stories coming into the world. If so, Ganesha and Hanuman and a universe of readers will all be delighted.


Andrew Leonard has been writing about technology and culture for 25 years. He is currently working on a book about Sichuan food and globalization.


Correction: An earlier version of this article said that Jerry Pournelle wrote his own word-processing program, dubbed Ezekial. In fact, he built his own computer dubbed Ezekial.


More Great WIRED Stories