Is nothing sacred? Er, no. There are still people who believe racism, child abuse and throat cancer are unsuitable subjects for comedy, yet in the space of a week I've laughed at lines about all of them. I didn't feel terrible afterwards, either. Scott Capurro has provoked mass walk-outs from his show with a gag which climaxes in the phrase 'Holocaust schmolocaust', but the people who thought this line beyond the pale were still outnumbered by those who sat there laughing. I would argue strongly that it's not intrinsically inappropriate or offensive to make people laugh at the darkest aspects of life and society. It's just really, really difficult.

There are various ways of attacking this problem, from Capurro's head-on provocation to the subtle, soft-soap charms of Omid Djalili, whose claim to fame used to be that he was 'the only Iranian comedian in the world'. Now there are two others, so his new unique selling point is that he's the only Iranian comedian in the world with a burgeoning Hollywood career (he sold Russell Crowe to Oliver Reed in Gladiator ), a plummy English accent (he was educated at Queen's, Belfast), and the ability to mimic middle-class women with two kids and a Range Rover fighting their way through a Waitrose car park.

'Out of my way, out of my way!' he shrieks with a face like a nun in a brothel, and 60 audience members howl with laughter. The sixty-first member of the audience sits pale-faced and tense, gripping the keys to her Range Rover. But not to worry, for a minute later she is grinning again. Djalili has no wish to offend anyone: he is, as he tells us from the outset in the thick Middle Eastern accent of a Bond villain, a 'crowd-pleaser', whose often pointed observations are always softened by his trademark 'winning smile'.

As with the young Lenny Henry, every serious racial point in his show is immediately undercut. Yet the point remains made. 'If you laugh at an ethnic comedian,' he says, 'you warm to his culture. So by the end of the night you'll be feeling very warm towards Islamic fundamentalism.' Djalili's strategy is to blow you away with a blizzard of gags, identities, accents and funny faces, as if to settle on one form of comedy for more than a minute would be to invite his worst enemy - boredom. The downside of this is obviously an inability to develop something slower and more thoughtful, but when you're a short, pudgy Iranian playing clubs full of drunken bigots, this is not the kind of activity you get much chance to practise. His reponse to hecklers who call him an 'Arab twat' is, he reveals, to reply: 'Thank you for reaffirming my identity.'

A Lump In My Throat has at its core another likeable man (journalist and author John Diamond) and a similar determination to prove that comedy is, like an inverted Yellow Pages, not just there for the happy things in life. This is a shorter, rawer version of the show that played in London earlier this year to rave reviews.

Most people in the first-night audience were Diamond fans, but it's not compulsory. Even if you don't like the columns, condensed into an hour they gain a new intensity. Performed by the charmingly downbeat Robert Katz, the evening starts off light and darkens deeply as the evening (and the cancer) progresses, but even at the end there are still cathartic laughs.

One of the most notable trends this year has been the increasingly blurred line between comic theatre and stand-up, and the most interesting shows often exist somewhere in that blur. A Man of Substance in a World of Filth is a one-man character monologue which keeps bursting into improvised interactions with the audience. Written and performed by the gawky, dynamic Andrew Clover, it is fairly unhinged, but never dull.

Clover plays a scholar of eighteenth-century literature who believes himself to be the reincarnation of Jonathan Swift, and who has a peculiarly intense relationship with his mother. Barking and braying, he takes us through his eccen tric life, family and self-made porn collection. Then he strips butt naked, prances around while making a deranged final speech, and runs off to a standing ovation.

Of course, not every comedy show at Edinburgh can be intelligent, lively and thought-provoking. There are plenty of chancers and idiots here to spoil the fun, and some of them are getting five-star reviews in other papers. One such is Jeff Innocent, a man whose musclebound suit and shaven, steel-lined head give you a fair indication of his life and material. He grew up in east London, got involved in crime, went to prison, and has come out the other end of the system a successful stand-up comedian.

In many ways this is an inspiring story, and you certainly couldn't accuse Innocent of glamorising violent psychopaths (unlike, say, most of the British media). There's nothing 'offensive' about him at all, in fact. Yet his rise is still deeply depressing. Because he is clearly not a natural stand-up: his style is an achingly competent, join-the-dots variety, every bog-standard gag and painfully timed facial gesture seemingly learnt at an evening course taught by Jim Davidson. Taboo schmaboo - in comedy, nothing is more offensive than a mediocre performer telling banal jokes.