The Beat Generation — those hep cats of the 1950s who brought drugs, jazz, and notions of existential freedom to the great grey postwar conversation — was defined by Jack Kerouac’s 1951 novel On The Road. It told the story of Sal Paradise (Kerouac’s nom de cool) and his wild friends as they crisscrossed America in their beat-up cars, having sex, smoking marijuana, and being existential.

Much like Ernest Hemingway defined the Lost Generation in the impotent anti-hero Jake Barnes in The Sun Also Rises, so Kerouac helped form the idea of the beatnik as a fusion of free verse, free love and free thoroughfares to everywhere.

Walter Salles, the Brazilian director who previously hit the highway in the Che Guevara film The Motorcycle Diaries, has turned On The Road into a throbbing, achingly cool movie that captures the ethos of the new, godless America and exposes its essential emptiness. Sal Paradise and friends travel from New York to Denver and back to New York and off to San Francisco and over to New Orleans and back again, being wild and unmoored and jittery and free and, frankly, kind of boring.

Sam Riley stars as Sal, a restless young writer whose imagination is captured by “the mad ones, mad to live … who burn burn burn like Roman candles across the night.” The maddest, and the most incendiary, is Dean Moriarty (Garrett Hedlund), an energetic piece of jive and fast driving who roars across the early highways of America on a restless hunt for drugs and sex and experience, all the while sporting the same white T-shirt.

Dean’s knockabout past, on railways or in car parks, makes him one of the great wanderers of American literature: Huckleberry Finn with a spliff. Based on the legendary Neal Cassady (who lived to become a 1960s icon as well), Dean throws himself into the life of sweaty jazz clubs, all-night drinking, and girlfriends for every hour of the day. He’s a man on the move, manoeuvring his beat-up Hudson down American’s early blacktops, a man desperate for freedom from everything, including responsibility.

On The Road follows Sal and Dean on several trips, along with cohorts who come and go through the legends of the beatnik past and its iconic artifacts. Carlo Marx (Tom Sturridge), a stand-in for Alan Ginsberg, is a gay poet who falls in love with Dean, who is prone to having sex with anyone who interests him at the time, or in some cases, who can enrich him.

At one stage they visit Bill Lee (Viggo Mortensen), an older hipster — and avatar for William Burroughs, author of the seminal Naked Lunch — who enters the story with random abandon and leaves just as abruptly, although not before making his mark as a precise, gun-happy eccentric who tries to purge himself of his discontent in an “orgone box,” a sort of Freudian outhouse that pays tribute (for those whose appetite for cultural history is unlimited) to psychiatrist Wilhelm Reich. On The Road has been trimmed from a longer version, and the Lee episode dangles from the narrative limbs, barely connected.

You want to linger there, but like Kerouac — who wrote his manuscript in a fever on a long scroll that he taped together and rolled through his Underwood typewriter — On The Road keeps moving.

The energy is fuelled by alcohol, drugs and sexual experiment, especially as embodied by Marylou (Kristen Stewart), a teenager whom Dean marries and then shares with other men: group sex is an act of brotherly affection in this company and Stewart brings a desperate eroticism to the role. For stability, there is also Camille (Kirsten Dunst), whom Dean also marries and impregnates and then leaves and then returns to, and whose suffering is just one of those things that happens on the lost and winding journey.

It all pulses to a be-bop beat of sepia streetscapes in which Salles evokes the pent-up energy of a country on the cusp: of poetry, of youth, of emptiness, of exhaustion. It’s fitting that On The Road belongs to Hedlund, whose Dean provides the movie’s thrumming heartbeat.

He’s a man in full-throttle pursuit of ruination, and he comes to it with an overflowing heart and no plans at all. “That’s not writing, it’s typing,” Truman Capote famously said about Kerouac’s book, and the film perfectly evokes that mood of meaningless hip.