In the opening sequence of T2 Trainspotting, Danny Boyle’s cheekily-titled sequel to his 1996 counterculture hit, Mark Renton (Ewan McGregor) is, once again, running. But he’s not a scrawny junkie, running from the cops. He’s a well-fed yuppie, running on a treadmill – and yes, the metaphor of that machine, which lets you exhaust yourself while going nowhere, is as unsubtle as ever. But it somehow works for Boyle, who takes the desperate-sounding notion of continuing this story and makes it seem less like a mad grab at former glory than a genuine opportunity to contemplate both reckless youth and staid middle age.

Not that Boyle has grown lethargic in his approach. T2 maintains the earlier film’s itchy, nervous energy – it’s snazzily and stylishly photographed (the camera mounted on a handheld microphone is a particularly memorable touch), and he moves and cuts at a breakneck pace. We catch up with our quartet of cheerfully nihilistic substance abusers two decades after the first film, which ended with Renton ditching his friends, swiping their £16K haul from a drug deal and vowing to go straight. The inciting action for T2 is simple: Renton returns to Edinburgh following his mother’s death, and takes the opportunity to get right with his former friends.

There’s a bit of subtext to this story of returning to one’s friends to address a perceived betrayal: Director Boyle and star McGregor broke through in indie film together, with McGregor starring in Boyle’s first three films (Shallow Grave, Trainspotting, and A Life Less Ordinary) before falling out over Boyle’s decision to cast Leonardo DiCaprio in his fourth film, The Beach – a role McGregor believed has been promised to him. T2 marks the duo’s first collaboration in nearly twenty years.

And thus, there are notes of melancholy and pathos you might not expect – though there are certainly the laughs (highlight: an improvised British Protestant historical song with the refrain “There were no more Catholics left”) and gross-out moments (hey there, guy throwing up in a bag over his head) you would. It has its problems: a returning Kelly Macdonald is wasted in a single scene role (while they bring in a younger model of female lead), the thick brogues can be (as before) rather indecipherable to these Yank ears, and it occasionally leans into too-precious self-awareness, particularly in the closing passages (though the final image is an all-timer). And while it takes nearly the entire film to realize it, there’s not a whole lot of plot; it’s mostly us waiting for the central quartet to end up in the same room again, which means working up to Renton’s face-off with the psychotic Begbie (Robert Carlyle), a bit of cleverly staged delayed gratification.

But plotting isn’t really what T2 is about, and they know it; it’s about coming to terms with one’s past, and how it informs what you’ve become. Two of its best moments rest squarely on McGregor’s mug: an early scene in which Renton puts a record on his turntable, hears the first two drumbeats of “Lust for Life,” and yanks the needle off; and a later scene of real danger, escaped by riding out of a parking garage atop a moving vehicle, arm sliced to shit. The regret and sadness on McGregor’s face in the first moment is indescribable, authentic, and powerful – but the gleam in his eye in the second scene packs as much of a punch. He still gets off on that jolt of danger and fear. You can’t change who you are.

“You know nothing,” Bulgarian romantic interest Veronika (Anjela Nedyalkova) tells Renton and Simon (Jonny Lee Miller). “You understand nothing. You live in the past. Where I come from, the past is something to be forgotten.” The specter of nostalgia sits heavily on Trainspotting, but Boyle uses it to its advantage, particularly in the way he has Renton revisit the iconic “choose life” speech, pivoting from the expected updates like “Choose Facebook, Instagram, Twitter, and hope that someone, somewhere cares” to something a bit more potent. “Choose unfulfilled promise,” he says. “Choose disappointment, and losing the ones you love.”

By pure Blu-ray-box-set-review happenstance, I revisited some of Richard Linklater’s Before trilogy the same day I saw T2 Trainspotting, and found it working me over in similar ways. Roger Ebert called cinema an empathy machine, which is true, but Linklater has also explored its possibilities as a time machine, and Boyle is mining that same vein (so to speak). There’s something elegant and evocative about how he uses his quick flashes of the first movie — as home movies, illustrations of memories, images of ghosts. He’ll intercut two shots of McGregor’s face with twenty years between them in a way that’s striking, because it’s not just the characters that have aged. It’s the actors, and it’s the director. And, of course, it’s much of the audience as well.

“T2 Trainspotting” is out Friday.