Fans of the uniquely dry and wry wit of David Sedaris’ writing and spoken-word recordings will be thrilled to know that “C.O.G.,” the first screen adaptation of his work, gets his voice just right. At the film’s premiere Sunday night at the Sundance Film Festival, Sedaris said he OK’d the project after having been impressed with writer-director Kyle Patrick Alvarez’s debut feature, the compelling and oddball “Easier with Practice.”

(Alvarez no doubt felt vindicated to hear Sundance programming honcho John Cooper admit, in his introduction to “C.O.G.,” that the decision not to screen “Practice” at Sundance has haunted Cooper for years.)

Based on an autobiographical essay from “Naked” that was too long to ever become part of Sedaris’ performance or even audiobook repertoire, “C.O.G.” tells the story of grad student David (Jonathan Groff), as he travels cross-country to pick apples in an Oregon orchard and have what his platonic gal friend Jennifer (Troian Bellisario) suggests will be a real “Grapes of Wrath” experience.

The fact that she arrives later than he does, and promptly announces that she’s going to San Francisco with her new boyfriend instead, doesn’t faze David, even though he’s clearly out of his element, both unaccustomed to physical labor (he assumes he gets to take a break when he’s tired) and unable to communicate with his Mexican fellow farm workers (he studied Japanese instead of Spanish).

Underscoring David’s adventures is a not-elaborated-upon disagreement with his parents, but it’s clear that their argument had to do with his coming out as gay, something that David himself seems reticent to deal with, even when he starts getting close to sexy factory worker Curly (Corey Stoll of “Midnight in Paris”), who has some strange secrets of his own. After a series of scrapes, David winds up in apprenticeship to craftsman Jon (Denis O’Hare), a bible-thumping born-again Christian who has his own issues with rage and alcohol.

Alvarez rides a fine line with the Candide-es que nature of the story, pointing out the absurdities of the people that David meets along the way (including memorable cameos by Dean Stockwell as an orchard owner and Dale Dickey as David’s unamused co-worker on a factory line) but never skirting the fact that wiseacre David has a lot to learn about the real world into which he is plunging himself after years of cozy shelter in academia.

Groff has made a name for himself on stage (“Spring Awakening”) and TV (“Glee,” “Boss”), but his star turn here establishes him as a major presence on the big screen. It’s a role that requires deft handling of both comedy and pathos, and he hits all the right notes. Stoll and O’Hare match their co-star in their scenes together, and the three performances really make the film soar, even when it hits an enigmatic ending that some viewers may find to have been more resonant on the page.

Also impressive in a smaller role is “Happy Endings” and “Saturday Night Live” star Casey Wilson in a rare dramatic turn — she plays a committed Christian wife without a whiff of condescension or irony, winding up as one of the film’s most purely generous and caring characters.

If “C.O.G.” is any indication of what can be done with the source material, here’s hoping Sedaris opens himself up to more adaptations in the future.