A movie simply called Brick suggests a musical version of Tennessee Williams's Cat on a Hot Tin Roof, though that would need to be accompanied by an exclamation mark. The film is, in fact, a refreshing private-eye thriller in a style now widely identified as neo-noir, and the brick in question is a block of heroin. The term film noir was coined in 1946 by French critic Lino Frank to describe the dark Hollywood melodramas that flooded Parisian cinemas after the end of the Nazi occupation and there's now a pretty general agreement that its heyday was from the early 1940s to the late 1950s.

Some argue that for specific cultural and social reasons, it belongs only to that period. Others take the view that there's a tradition of noir movies that began in 1913 with Louis Feuillade and proceeded variously through German Expressionism in the Twenties, the French poetic-realism of the 1930s, American film noir, and thence to the present.

Film noir was a movement and a style and wasn't accepted as a Hollywood genre. Its American practitioners were as unaware of making such films as Monsieur Jourdain, Molière's bourgeois gentilhomme, was that he was speaking prose. But those involved in neo-noir are working self-consciously, as Foster Hirsch makes clear in his admirable book, Detours and Lost Highways: A Map of Neo-Noir, especially when making retro-movies like Chinatown and Farewell, My Lovely, which recreate the Los Angeles of the Thirties and Forties with loving care. These people know the conventions, the visual style, the verbal mannerisms and the dramatis personae of the genre and well-versed is Rian Johnson, the young writer-director of Brick.

Johnson's low-budget picture was shot in his somewhat anonymous home town of San Clemente, which straddles the San Diego Highway south of Los Angeles, in the deeply conservative Orange County, and is set in and around the local high school. But to describe Brick as a full-blown noir thriller involving teenagers suggests that it's some kind of whimsical spoof like the slightly creepy Bugsy Malone's take on gangster flicks. Or, at best, that it's parodic in the manner of the 1947 comedy My Favorite Brunette, in which baby photographer Bob Hope stands in for his neighbour, private eye Alan Ladd, or the marvellously postmodern Dead Men Don't Wear Plaid, where clips from a dozen 1940s thrillers are woven into a story involving Steve Martin's wisecracking detective. Johnson's movie is, on the surface at least, deadly serious, though extremely funny in its hard-boiled dialogue and generic conceits.

The film's hero is the good-looking, bespectacled, wryly determined Brendan Frye (Joseph Gordon-Levitt), a cross between Hammett's Sam Spade and Chandler's Philip Marlowe as played by Bogart in The Maltese Falcon and The Big Sleep. He's investigating the disappearance and death of an ex-girlfriend, Emily, who's fallen in with bad company. Various clues come his way - bits of photographs, an invitation to a party, a piece of paper with a cryptic sign and the word 'midnight'.

Along the trail, he meets assorted noir archetypes. One of them is the school's femme fatale, with the resonant name of Laura, who's a cross between Bacall in The Big Sleep and Mary Astor in The Maltese Falcon. Another is the sinister drug-dealer known as the Pin, a mixture of Jules Amthor from Farewell, My Lovely and Casper Gutman from The Maltese Falcon, and he has a sculpture of a black bird on his desk.

The abrasive, wisecracking encounters between the old-style private eyes and the cops take place here between Brendan and the school's black vice-principal (Richard Roundtree) and are shot from familiar low angles that emphasise the inherent menace and conflict involved. The effective, bluesy score is by Nathan Johnson.

The violence, when it occurs, is wholly realistic and Brendan receives it and hands it out in traditional sadomasochistic fashion. He's knocked out several times with fades to black as he goes under. But he absorbs the punishment like a punchbag and recovers to pursue his quest. To misquote Chandler, Brendan knows that 'down those mean school corridors a boy must go'.

From time to time, he breaks off to make rapidly spoken summaries of the labyrinthine plot and moral comments on social mores. The use of the school and the spaces around it (the playing field, for instance) are part of the drama, and crucial, too, is language. The production company has provided a glossary of the supposedly obscure terms used in the picture. This recalls the 12-page 'Glossaire argotique' at the end of Gallimard's Série Noire edition of Albert Simonin's classic crime novel, Touchez pas au Grisbi! But just as French crooks will understand the underworld argot used by Simonin, so readers of Hammett, Chandler and their contemporaries will recognise the dated slang used in Brick: 'Bulls' (cops), 'yegs' (tough guys), 'burg' (town), 'shamus' (private eye), 'take a powder' (to leave) and so on.

Brick is an immensely enjoyable film, a virtuoso exercise that is at once an affectionate homage, an exercise in romantic fantasy and an oblique commentary on teenage life. We're simultaneously engaged by its attractive hero and invited to stand back and watch him from a distance. However, those who do not enter into the spirit of the piece may well find it deeply irritating.