Writer Robin Sloan, whose debut novel "Mr. Penumbra's 24-Hour Bookstore" is now out, speaks with guests during a recent appearance at City Lights.

Photo: Carlos Avila Gonzalez, The Chronicle

Writer Robin Sloan, whose debut novel "Mr. Penumbra's 24-Hour...

Image 2 of 2

Robin Sloan, a former Twitter media manager and author of "Mr. Penumbra's 24-hour Bookshop," at City Lights Book Store in San Franciso, Calif., on Thursday, November 8, 2012. City Lights inspired the fictional book store in his novel.

A successful Twitter executive and aspiring writer, Robin Sloan knew he was destined to write something more than 140 characters long. So despite the creature comforts of the office and his status as a rising media philosopher, he quit his job.

Before long, he canceled his iPhone plan ("It would rise up at my face like a choking arm!" he says) and moved to a small town in Italy, where his girlfriend was taking a cooking course and Sloan could devote himself to turning one of his popular online short stories into a novel.

"I had all these Twitter followers and was getting known," says Sloan, 32. "But the half life of a tweet is about five minutes. I hate the idea that this stuff just disappears. Books are anchored. You return to books. You don't return to a tweet."

These days, Sloan - a self-described "writer x media inventor" - is the computer code-savvy literary philosopher for the tech set, determined to capture the complex milieu of the texting age. Between his popular blog, SnarkMarket, his nearly 300,000 Twitter followers, and his poems (which can only be read as smartphone apps), he has carved a niche for himself as a thoughtful observer dedicated to documenting what he considers a misunderstood group - the young technocrat.

"The startup guy has gotten short shrift in literature. He's either forgotten or mocked," says Sloan. "Fiction is about cataloging characters - I wanted to finally add him to the catalog."

In his debut novel, "Mr. Penumbra's 24-Hour Bookstore" (Farrar, Strauss, and Giroux; $25), Sloan pits a bookstore whose customers play an ancient, mysterious game against a futuristic Google filled with bright young minds. The Googlers code this ancient game and, in doing so, threaten its existence. An epic battle ensues - between mysticism and engineering, books and scanners. Throughout, Sloan is playful and forgiving of both sides. Most remarkably, he makes coding look action-packed and cool in a way that only someone who's done it could.

Playing peacemaker

Walking through San Francisco's Sunset District one recent foggy morning, Sloan, in a zip-up Patagonia sweater and jeans, says that modern novels should take a kinder stance on young techies and that young techies should be more receptive to books. Sliding between discussions of programming languages and the history of bookbinding techniques, he seems to position himself as a sort of peacemaker.

"There's certainly satire written about techies, but it's so snarky and snide and doesn't treat him as a whole person," he says. "The people I worked with at Twitter - they're very analytical, but they're also deep and thoughtful - I feel like they deserved a charismatic spokesperson."

He had published "Penumbra" first as a short story on Amazon, and about 5,000 people bought it. But he didn't expect to hear anything more about it, he says, because attention online is like a roving prison spotlight.

"It goes POW POW," he says, shooting his arms out emphatically. "But I just kept getting e-mails about the story for a long time after - like weeks after. If something online lasts for weeks, you should take it very seriously, so I did."

He returned from Italy with a manuscript, and now his book is a New York Times best-seller.

Sloan is not the only novelist to incorporate technology into the structure of his narrative, but most writers treat it in a negative, dark way, he says.

"Is it possible to talk about now, at the crux of human nature and technology, without resorting to darkness, cynicism and acting like we're ruining civilization?" he says, shaking his head. "You can't think of technology as separate from all of our human drama anymore. Sure, 10 years ago, maybe, but now no, it's not possible."

He holds faith that hardcover books and the Internet can co-exist. His novel is printed with a glow in the dark cover. "The book is a great piece of technology," he says. "The Internet doesn't negate that."

Small-town roots

The son of a home economics teacher and an appliance salesman, Sloan grew up in a small town near Detroit. He loved computers and fantasy novels, especially if they involved dragons.

At Michigan State, Sloan studied economics and founded the undergraduate literary magazine, Oats, but never thought of himself as a writer.

He moved to San Francisco to work for Current TV, a participatory broadcasting startup, before leaving for Twitter, where he helped news stations condense their reports to 140 characters.

He and his girlfriend, the chef Kathryn Tomajan, recently moved from the Sunset District to Rockridge in Oakland. In November, he went to one of her Eat Retreat weekend-long cooking lessons and learned to slaughter his own chickens.

During a recent appearance at City Lights, he is surrounded by bloggers seeking interviews. His friends from Twitter sit in the back drinking. Neil Shah, 30, was Sloan's co-worker in the media department.

"My wife works at Yahoo, and I'm like, 'Look, he's talking about Yahoo! He's talking about us!' " says Shah, who bought the book on his Kindle. "You have to wonder, is it timeless or will the technology date it? And I think it is timeless. You write in your time and it stays.

"With Twitter, 140 characters is a good way to communicate a message - but it's not going to capture fiction. I have not seen anyone else doing this, no one who is making it real time and relevant to our moment."

After the reading, Sloan sits in back, drinking a martini. His favorite drink, however, is the Old Fashioned.

"At most bars, in their lust to make them unique, to use organic blueberries they grew themselves or something, the bartender makes them too fruity. Sometimes an Old Fashioned should be left alone."