In Iran today they have a machine for cutting off the arms of convicted thieves, one of the many "reforms" imposed by the regime of Ayatollah Ruhollah Khomeini.

"Technological progress," said Iranian journalist Amir Taheri, a wry smile barely dancing across his face.

"It caused a big debate," he continued in a dispassionate tone. "There are mullahs who are against the machine because they say it makes the operation painless, and therefore detracts from the original weight of the punishment. The humanists favor the machine precisely because it is painless. So it has been adopted in some cities and banned in others."

Of course, he cautions, the arm isn't chopped off for a first offense; for that the criminal is merely beaten. With further convictions the beatings increase and he begins to lose pieces of his arm: first a finger, then two, then three.

Taheri lives in Paris now, where he works for a French magazine. He stayed in his homeland for six months after the ayatollah came to power, but fled in 1979, leaving behind most of his possessions, a few days before he would have been purged from his job editing the largest daily newspaper in Tehran. His book, "The Spirit of Allah," a biography of Khomeini, has recently been published in this country, following its debut in England, France and West Germany where it has been a best seller. (It has had mixed reviews here, with some writers complaining about its rather dense prose.)

Writing the book was one way to make some use of the knowledge he had earned during 11 years as a journalist in Iran, and to try to make some sense of the whole bizarre experience.

"I thought that Khomeini deserved to be properly introduced," he said. "The tendency has been to put him aside and deny that it was his revolution . . . This is not true. He deserves credit."

Americans watched with confusion and horror as Iran, once a little-known land somewhere in the Middle East, came into focus with terrifying clarity as the place where 52 Americans were held hostage from November of 1979 to January 1981. In the history of Iran, that incident will be recorded as a short chapter in what proved to be a major revolution -- one that in the eyes of westerners turned the country into a medieval outpost ruled with surrealistic flair by religious despots.

It is this revolution that Taheri chronicles. The story of Khomeini traces the tensions and currents that turned into a full-scale rejection of everything perceived as western, from music and poetry to equality for women.

The ayatollah, Taheri writes, is now virtually a prisoner, so afraid of assassination that for six years he has not left the fortified village in the foothills of Northeast Tehran in which he lives. "He's like a figure in Greek tragedy," said Taheri. "He's brought it all on his own head. I detect a very faint note of remorse in his recent speeches . . . I can read his semiology. I get his signals. I am a Khomeini-ologist."

He began collecting information for the book as soon as he left the country. He returned for a few months in 1980, but has not been back since. His reading ranged from the Koran, the holy book of Islam, to everything Khomeini ever wrote. "That I wouldn't recommend to my worst enemies," he said.

One person he interviewed was murdered between sessions; not because of the book, he hastens to add, though it's hard to know for sure in a country where a "crime against Allah" can be drinking whiskey, writing poetry or, for a woman, failing to wear a veil, and crimes against Allah are punishable by death. "It could be anything," he said. "A 9-year-old girl was shot because she poured pepper into the eyes of a revolutionary guard during a demonstration. She was warring on Allah." He writes of homosexuals being hanged from trees in one city, and an 18-year-old pregnant woman being executed by a firing squad after being accused of fornication.

Khomeini disapproves of all art, Taheri said, because it brings pleasure and that is a seduction to weakness.

"There are people who say Khomeinism is not really Islam. I say it really is Islam, but Islam is not only Khomeinism, just as the Inquisition is quintessentially Christianity, but Christianity is not only the Inquisition."

Taheri first encountered Ayatollah Khomeini when, as a young journalist, he was assigned by the editor of the English language paper he worked for to discover the possible successors to the recently deceased grand ayatollah of the time. "I thought it would be like a U.S. presidential race," he said. "I didn't have the faintest idea how these people operate. I interviewed all the likely successors and of course one of the names mentioned was Khomeini, but I couldn't interview him because he was in exile. You were not even allowed to print his name. But I wrote an article and included several paragraphs about him, and the editor quite courageously published it. And this was the first time his name had been published in Iran for five years."

His editor, he said, had developed a system of printing controversial articles on Thursday, the eve of the Moslem weekend. "The advantage was that we were writing in English, and by the time the whole thing was translated it was cold stuff. Other felonies would have been committed in the meantime to attract attention."

Taheri, the son of a professor of English literature at the University of Tehran, left the country at 15 to finish his education in Great Britain, then the fashionable country for middle- and upper-class Iranians. He found work on the English language newspaper after a short stint as a teacher of economics and failing to get into the foreign service because he had a non-Iranian wife (she's French).

"The first assignment they gave me was as a 'lobby reporter' during a monthlong conference on human rights. That meant I was to hang loose in the lobby and hear rumors. It was a useless job."

Unlike Persian newspapers, the English one was privately owned, and so less vulnerable to government pressures. In 1973, when Taheri became editor of Kayham, the largest daily newspaper in Iran, he found that of 153 employes, 140 actually worked for the shah. "You had somebody who was a taxation reporter, but he actually worked for the IRS," Taheri said.

Taheri replaced as many as he could with the new graduates of the first professional training program in journalism in Iran, which had been organized by the newspaper. Many of his new hires were women, he said, "because they were stronger than men and less vulnerable to pressure and temptation . . . So we started a new type of journalism which involved a guerrilla war against the authorities. But our troubles didn't end there because we were also under pressure from the people."

Taheri explained that in a country without political parties, unions or associations, "the people expected me to perform the tasks and duties of the institutions they didn't have." The idea that a journalist's job is to report the news and not help make it was difficult to explain. "The shah's government wanted me to make them popular with the people . . . The people, on the other hand, wanted me to fight the government, which was not my business either."

When he published an advertisement announcing a memorial service for Khomeini's son Mustafa, adding a standard condolence message from the newspaper, "all hell broke loose . . . There were memorial services all over in all the mosques" because people assumed that the publication of the ad was a sign that officialdom was relaxing the ban on Khomeini. The massive turnout for memorial services held in 200 cities was interpreted as a protest against the government.

When he printed a photograph of one of the services, accidentally edited to make it look as though the mosque was full, "The ayatollah thought I had done it as a favor to him and placed me on the favored mailing list, allowing me to receive all his diatribes."

Later he refused to publish a government-produced letter that claimed Khomeini was a homosexual and a drunkard, believing the letter was unfair. Another paper did, and its offices were attacked. Again Khomeini's supporters interpreted his refusal to publish the letter as a sign of support.

At the same time, he wrote editorials saying that anyone who expected Khomeini to bring democracy to Iran was crazy. "If you want cigarettes you don't go to a butcher shop," he said. "No priest can be expected to bring democracy." But he found that people interpreted this position as support for the shah.

In retrospect, he said, he should have either remained completely neutral or left the country. But he had the journalist's unquenchable curiosity and wanted to witness for as long as he could the events that were shattering his homeland.

Now, he says, of the 153 people who worked at his paper, only 10 to 15 remain, most of them production assistants. The others are in self-imposed exile, another line of work or dead.

"I have a graveyard full of friends," Taheri said. The man who was his deputy editor was killed in prison, when "they cut his vein," because he refused to go on televison and say he had converted to Islam. Three of his brothers remain in Iran; his parents moved to England well before the revolution and remain there.

The shah fled sooner than Taheri had predicted he would, he said, and as turmoil became a way of life, "many people were escaping left, right and center, selling their houses and their jewelry and mink coats, withdrawing their money from the bank. There was an end-of-an-era atmosphere, a lot of hedonistic parties, lots of arguments and debates."

He stayed as long as he could, but left when friends warned him he would be replaced by a Khomeini sympathizer. "I expected it," he said. "I was not surprised." But he is a reluctant exile.

"My apartment is still in Tehran. I still have two bank accounts there, with $2,400 in them. All my books, my records, my clothes are still there. I could have them sent to me, but I don't want to. Why should I? My heart is there. I don't want to live abroad. I hate it. I will die if I have to live here for a long time.

"I feel out of context. A vagabond, like the Flying Dutchman. That is why I can't stay in one place. I go from Paris to London to the United States. A restless soul.

"But life is unpleasant and uncomfortable there. Why go back? Unless you are a masochist. Thousands have escaped and every day thousands more."

While in London, he worked for the Sunday Times as Middle East correspondent, and then left to start a weekly newspaper for the Iranian exile community in the United States. It has the same name as the paper he worked on in Iran, Kayham, which means universe. He wrote a pamphlet on ways to circumvent press censorship for the International Press Institute ("It's been selling very well in the Philippines," he notes). Now he works for Jeune Afrique, a French monthly, and lives in Paris with his wife and two teen-age daughters, who show little inclination to return to Iran and don the chuddar. sk,2

He sees little hope of another revolution deposing Khomeini. "Many people are tired, wounded, hungry, cold, miserable. People must have a relative degree of comfort before they make a revolution."

The country is ruled by the mullahs, he said, but run by thousands of people who were educated in the United States and Europe. They are the ones who make the trains run and keep the system, such as it is, rolling. And it is in this group that Taheri sees some hope of things changing for the better. "They have their beards and they chant 'Death to America' in front of the TV cameras, but I can't believe they are that dumb. I think they are biding their time."