One Wednesday evening in January, David J. Peterson stood backstage at The Daily Show’s set in Manhattan, teaching Trevor Noah, the show’s host, how to speak Kinuk’aaz. No teacher could have been better suited to the lesson: Peterson invents languages for a living, and Kinuk’aaz, an alien language spoken on the Syfy-channel show Defiance, is one of his creations. Others—there are about 40 in all—include High Valyrian, the mellifluous tongue of power players on Game of Thrones; Trigedasleng, a dialect descended from English and spoken by humans in a post-apocalyptic future on the CW drama The 100; and Noalath, a language used by druids on MTV’s The Shannara Chronicles.

In the softly lit greenroom, Noah and Peterson drilled a dialogue they planned to perform during Peterson’s interview, including a Kinuk’aaz greeting: Guderet k’agetirim (“Welcome to the show”). Noah slowly sounded out the phrase. “Goo-dee-ret kag-eh-tee-rum. Like that?” he asked. Peterson, whose long brown hair was parted neatly down the middle, repeated the second word back to Noah in a guttural tone. “K’agetirim,” he said. “Say it with a German r.” Noah speaks eight languages (among them German, Zulu, and Xhosa); he voiced the r deeper in his throat this time, perfectly mimicking Peterson’s pronunciation. A producer signaled that it was time to go, and as Noah left the room, he practiced the harsh, explosive syllables under his breath: “Guderet k’agetirim! Guderet k’agetirim!” He paused in the doorway and shook his head. “Yeah, I wouldn’t want to speak Kinuk’aaz,” he said. “I’m more … High Valyrian.”

Half an hour later, Peterson walked onstage to discuss his new book, The Art of Language Invention. Noah greeted him with the Kinuk’aaz phrase they’d practiced, or something that sounded a little like it: “Ku-ta-rekt kaka-teh-reem!” he said. Peterson’s languages might be made up, but they aren’t gibberish; they have consistent grammar and phonology. You can speak them wrong—even their inventor trips up from time to time. When Peterson returned backstage, I asked how Noah had fared in Kinuk’aaz. “Good effort,” Peterson said, chuckling. “But he botched it.”

In one sense, all languages are inventions. Most have been constructed haphazardly, through centuries of linguistic improvisation and collaboration. But some—the ones that linguists describe as invented languages—trace their existence to individual creators. The oldest known invented language, Lingua Ignota, was devised in the 12th century by the German nun and mystic Hildegard von Bingen; its purpose has been lost to history. During the Enlightenment, European philosophers aspired to create languages that could express any concept in the universe with precision. As Arika Okrent notes in her 2009 book, In the Land of Invented Languages, the results were so complex—requiring reference to charts and diagrams and indexes—that no one ever used them. Later, a wave of 19th-century utopians and idealists hoped universal languages would promote international harmony. Almost none of them made it far beyond their inventors’ notebooks. (One, Esperanto, did catch on. Although it has thus far failed to bring about world peace, it has hundreds of thousands of speakers—Peterson among them—and a translation option on Facebook.)

In the 20th century, the most prominent invented languages were made for fictional worlds. J. R. R. Tolkien, who was equal parts fantasist and philologist, spent decades developing Quenya and Sindarin and all the other languages of Middle Earth; he wrote The Lord of the Rings as their vessel. “Nobody believes me when I say that my long book is an attempt to create a world in which a form of language agreeable to my personal aesthetic might seem real,” he told one of his sons in 1958. “But it is true.”

Language creation’s next big moment came in the 1980s, when a linguist named Marc Okrand brought Klingon to life for the movie Star Trek III. Only a handful of Klingon words had appeared in earlier Star Trek movies; using them as his guide, Okrand established a basic phonology and grammar. After that, he created only whatever words the script called for. The language was essentially an illusion, like the cozily furnished set of a sitcom living room. “It looks real from up close,” Okrand told me, “but step far enough back and you can see it’s just a bunch of plywood held up with two-by-fours.” At the urging of the film’s crew, he went on to flesh out the language; a Klingon dictionary he published after the movie came out sold more than 300,000 copies.

If Okrand approached Klingon like a set-builder, Peterson approaches his fictional languages like an architect. When he created Dothraki, the language spoken by a nomadic warrior tribe on Game of Thrones, he mapped out the history of every word, devising versions of the language as he imagined it existing in the past (including thousands of words that would never be needed on the show). As Okrand told me, Peterson not only “creates the whole house—he does archaeological research to see what was on the land before the house was there.”

Peterson first got interested in invented languages in 1999, at the age of 18, when he found a copy of Montagu C. Butler’s Step by Step in Esperanto at a book sale. The following year, while he was learning about morphology in an introductory linguistics course at UC Berkeley, it dawned on him that linguistic rules were like tools, and he could use them to create a language of his own, one that functioned however he liked. His first language—which took inspiration from Arabic and Esperanto—was “a complete failure,” he says, a fact he realized while attempting a translation of Shakespeare’s The Tempest. “I was just reinventing English in a very poor way,” he told me. If English had a term for something, so did Peterson’s language. It hewed so close to the English lexicon that it had direct counterparts for mariner, sailor, and boatswain.

After graduating, Peterson got a master’s degree in linguistics from UC San Diego and continued to immerse himself in languages (all told, he has studied more than 20 of the noninvented variety, though he considers himself fully fluent in just two, English and Spanish). He then spent two unfulfilling years teaching English at a community college in Orange County, before quitting to write a satirical novel, which he never published. All the while, his interest in language creation remained, to borrow Tolkien’s phrase, “a hobby for the home,” something he only dreamed of making a living from.

His fortunes turned in 2009, when the creators of Game of Thrones contacted the Language Creation Society, a group he had co-founded, soliciting submissions for a Dothraki-language-creation contest. Although language creation wasn’t yet a TV fad, they seem to have sensed that gibberish wouldn’t do. The show, after all, was based on a popular series of books whose readers were captivated by its complexity and detail. Moreover, the nature of TV viewership was changing. Armed with DVRs and social media, fans were growing more attentive than ever before: They cataloged costumes and cliff-hangers for crowdsourced encyclopedias; they converted characters’ every facial twitch into gifs; they called out inconsistencies and anachronisms on Twitter. Increasingly lavish budgets and production values rewarded their high expectations. Gibberish would slip by many viewers, but not all of them.

Peterson’s Dothraki entry, which ran to 180 pages, beat out some three dozen others. By 2013, Game of Thrones was one of the most-watched dramas on television, other major networks were clamoring to get invented languages on their shows, and Peterson had enough work to employ him full-time as a language creator. Although it is exceedingly rare for an invented language to take on a life of its own, he has been inundated with translation requests from viewers. He tries to respond to each one, improvising when necessary. Not long ago, one Game of Thrones fan wrote with a special request: Was there a way to say sociology girl in Dothraki? She wanted a tattoo with the phrase. The Dothraki inhabit a world where horses are the primary mode of travel and fire-breathing dragons circle in the sky—a world, perhaps needless to say, unacquainted with sociology. “There is not and will never be a word for it,” Peterson told her. Still, he offered a translation: nayat fin avitihera vojis sekke—“girl who will stare at people too much.”

Learning a made-up language is not easy, and Peterson wants to help actors get it right. He has spent hours on the phone walking them through their lines, syllable by syllable. It can take days to get the pronunciation down. Nichole Galicia, who played a Kinuk’aaz-speaking alien on Defiance, told me she was once given new lines just hours before she filmed a scene. With little time to practice, she was unable to master them all. Midway through the scene, she blanked and blurted out the first Kinuk’aaz phrases that came to mind. “I was saying ‘Happy holidays’ when I should’ve been saying ‘You disgust me and disgrace our people,’ ” she told me. No one on set knew the difference; the director deemed the take her finest performance. Galicia, however, was mortified. She ran to her trailer in tears and called Peterson to apologize for “butchering” his language. “I’m sure it’s worse in your imagination than it actually was on film,” he assured her. “And if it’s dreadful, we’ll dub the scene.” They dubbed it.

The morning after his Daily Show appearance, I met Peterson at his hotel for a language lesson of my own. Fancying myself, like Trevor Noah, a High Valyrian kind of guy, I hoped Peterson might teach me to order coffee (“just cream, no sugar”) in the language. But it turns out that coffee, like sociology, doesn’t exist in the Game of Thrones universe, and so High Valyrian lacks the words I needed to place my order.

I’d have to settle for Castithan, Peterson said, the language of a race of aliens on Defiance who have done trade with humans, and thus encountered the beverage. Consulting a 317-page dictionary on his iPad, Peterson found the Castithan words for coffee (kofya), cream (krima), and sugar (shugara). He scribbled a translation on a piece of paper and read it to me once, at full speed: “Kofya ksa zhulawa, krima ksa fivi, shugara kanwa.” Then came my turn. It sounded easy enough to pronounce, but I started slowly: “Kof-ya ksa jah-lah-wah—” Peterson cut me off. “That’s a u,” he said. “Try it. Zhu-lah-wah.” After a few minutes of repetition and correction, the sentence was still wobbling off my tongue. Peterson graded me: good pronunciation, poor inflection.

Castithan, he said sympathetically, was a “tongue twister”; the Defiance actors had struggled with it too. I was heartened by this—and by something I’d heard him mutter to himself at the outset of our lesson. “I could do it in one of the Defiance languages,” he’d said, as he pondered which language to teach me. “I just don’t speak them very well.”