The experiment in “Yes,” written and directed by Sally Potter, is to see whether a modern writer can compose dialogue in rhyming iambic pentameter without the stunt overshadowing the film’s actual content. The answer is a qualified yes, the style usually works, and the movie usually works, too. As is often the case, I’m just glad to see someone trying something different, whether it’s completely successful or not.

The story is of a woman, called only She (Joan Allen), upper-class, monied, and stuck in a loveless marriage with a philandering husband (Sam Neill). Their maid (Shirley Henderson) knows all the secrets and tells them to us in whispered soliloquies.

This desperate housewife chances to meet a Lebanese chef called He (Simon Abkarian) and they begin a passionate, discreet affair, She feeling only mildly guilty for cheating on her lousy cheat of a husband.

The complication is with her lover himself. He is Muslim, and there is tension at his job, and he eventually can contain his hatred for the blue-eyed Western imperialist devils no longer. He lashes out and is fired, whereupon he lashes out against his lover, too, telling her it’s over, that their differences cannot be overcome.

Through it all, everyone speaks in verse, usually rhyming, and not just when giving speeches. The dialogue is rhythmic and poetic, too, even Shakespearean. (The presence of a domestic servant who speaks directly to the audience reinforces that comparison.) At times the dialogue feels constrained by the limitations imposed on it, with rhymes that sound forced and unnatural-sounding language. Some of the actors occasionally slip into a sing-song voice, too, which does the language no favors. (I exclude Joan Allen from that observation, however. Her powerful performance here just adds to her reputation as one of Hollywood’s greatest actresses currently working.)

But in large part, it works. It’s rare to see a movie that sounds like poetry, and rarer still to see one whose ideas and themes warrant such treatment. “Yes” wants its characters to live life, to be shaken from their complacency and to see the limitless possibilities the world has to offer. Iambic pentameter fits a film like this better than it would, say, “White Chicks.”

B (1 hr., 40 min.; R, a lot of F-words, some mild sexuality.)