At Hofuf, on the edge of the great Empty Quarter of Arabia, three rapists were punished a few months ago.

One of them was an unmarried man who, mercifully, was beheaded with a single stroke of a sword.

The other two, both married, paid a harsher penalty. They were buried up to their hips in sand, according to an American eyewitness. The assembled crowd stoned them from a distance of about 20 yards. The stones were small - about the size of limes - and there was no single, lethal blow. The men died slowly, bleeding profusely, crying out now and then in their agony.

"I watched it for a while and then I had to leave," said the American. "A little of that goes an awful long way."

Other stories out of Saudia Arabia recently have made, in equally dramatic fashion, the point that the relations between men and women here are matters of enormous sensitivity. A royal princess and her lover were executed at Jiddah last summer for the crime of adultery. The stoning of adulteresses by village women is still reported now and then.

To many westerners, these incidents merely create or reinforce an image of barbarism in the desert kingdom. But there is more to it than that. Fundamental social issues concerning the role and status of women are involved.

Jiddah most definitely is not Brooklyn. Hofuf is not Brookline. And Saudi society is not governed by the precepts of either Larry Flynt or Betty Friedan.

This is a stern Calvinist world in which Hester Prynne with her scarlet letter would feel at home. Its theology, mandating the subjugation and isolation of women, derives in part from words in the Koran asserting that "men are a degree above [women]." But mainly, the British journalist Peter Mansfield has written, it derives from "the scholars and casuists of Islam in later centuries who succeeded in interpreting the Koran . . .in such a way as to place women in subjection . . .Seclusion and the veil which were intended to give women privacy and protection in a formerly licentious society became a form of imprisonment. Islam has no clergy; every man is priest and patriarch in his own household. Men exploited this power to dismiss wives at a whim. Divorce . . . became an instrument of male tyranny."

Thus, double standards for the sexes arose. In Saudia Arabia today, polygamy is permissible for men but the iron rule for women is monogamy. At dinner in one of the small palaces here a couple of weeks ago, a young prince speculated, half-serously, on the pros and cons of acquiring another wife. "But she would probably spend too much money," he concluded. His present wife, the daughter of a former king, smiled serenely and kept her silence.

These disparities are everywhere apparent. A man may marry outside the Islamic faith. Such a marriage for a woman is punishable by death. Women may not drive automobiles. They may not travel without the consent of their husbands or guardians and only then in the company of relatives. They may not appear in mixed company on social occasions (except, as often happens at the higher levels of society, with the consent of the husband). They can hold no job that brings them into contact with men, which means, for all practical purposes, that there are no women in the labor force. They are totally segregated in the educational system, taught only by women except for the occasional male instructor who comes into the classroom by way of closed-circuit television.

Rosalynn Carter, the wife of the American president, discovered the way it was during a visit to Riyadh last month. In public she walked a respectful distance behind her husband and was excluded from the state dinner given by King Khalid.

("She overdid it," a Saudi man noted in jest. "She didn't have to walk six steps behind; we only require two.")

THIS WAY OF LIFE has persisted for centuries and is unique in the Middle East. No other Arab or Islamic nation builds such a wall between its men and women. Even Oman, preserved intact from the Middle Ages until 1970, is now integrating women into its social structure.

The Saudis are different because they cling tenaciously and as a matter of conscious national policy to the 18th century religious doctrines of Muhammad ibn Al-Wahhab. His flaming, puritanical evangelism was joined with the swords of the Saud family to create what has become the modern Saudi state. Wahhabis, it is often said, are the Mormons of the Middle East.

The question that today preoccupies both westerners and Saudis is whether this religious fundamentalism, with all its implications for women, can survive the tides of modernism that now sweep across the desert kingdom as a product of its newfound wealth in oil.

A western diplomat in Jiddah thinks "forces for change are building gradually and we find a ready soil with women." That is the view of some Saudis among the thousands who are being educated in the United States and Europe. And there is some evidence that minor change already is under way.

The inclusion of women in the educational system, even on a segregated basis, has enormous implications for the future.

The official policy for education here spells out the "girl's right to obtain the education which suits her nature and prepares her for her task in life provided this is done in a decent and dignified manner and in the light of the Islamic law, as women are the sisters of men.

"The object of woman education is to bring her up in a sound Islamic way to that she can fulfill her role in life as a successful housewife, ideal wife and good mother, and to prepare her for other activities that suit her nature such as teaching, nursing and medicine."

Abdallah al-Khywaytir, the conservative minister of education, expresses the ambivalence of the Saudi approach:

"If we were wise enough to be rational instead of sentimental, they (women) would find their righful place. In other Arab countries they have thrown the woman into the ocean before she is ready to swim. They are concerned with the peel (appearances), not the core. There is no reason to put women in office just to prove we are advanced. Is she needed there? Is she more needed at home? We need social workers, nurses, teachers, doctors. We should plan for those things. But I should not think it right for a girl in Saudi Arabia to go study in economics or engineering, for example. She is not accepted later on. It is not enough for people in high places to try to force this on society. Let society adapt first . . .Sometimes the medicine (change) brings illness."

SOCIETY, in small and sometimes hypocritical ways, is adapting. Women from America and Europe are still subject here to many restrictions. They may not drive cars, for example. But they now shop in the markets in western dress, free of concern that the Morals Police will paint their bare arms and legs in disapproval, as was formerly the case.

In the huge American-Arabian Oil Co. complex at Dhahran, an isolated island of western civilization, Saudi women in American-style clothing work side by side with men. One of them reads the news on the Aramco radio station. Some have become sufficiently westernized to play hostess at cocktail parties featuring the homemade liquor invented by the Americans which is called sadeeki , the Arabic word for "my friend."

In Jiddah, it is reported that Saudi businessmen are now seeking out American and U.S. women to act as secretaries in their offices.

Rich Saudis for some time have lived double lives. In the privacy of their own homes and in the embassies, men and women in western dress mix easily. And in their travels abroad, they do as the Romans.

One of the royal princes, Bandar Sultan, jokingly says that the spearhead of the women's movement may come from the Bedouins in the desert. "Their women have started driving trucks out there," he says, "and I'm not kidding."

Surprisingly, some of the Saudi most skeptical on the likelihood of substantial change in the lives of women are intellectuals who have gotten doctorates in the United States and who hold important positions in the government.

Ghazi al-Gosaiby, the brilliant minister of industrial development, thinks the "woman's work role will continue to expand but will not change drastically in the foreseeable future. There is too much social opposition."

He and others still remember that when the first school for girls was opened a few years ago, there were protest riots by Wahhabi fanatics, as there had been riots even earlier when the first truck appeared in the country. (The vehicle was burned.)

Abdullah Hassan Masri is another skeptic. He is in his early 30s and holds a doctoral degree in anthropology from the University of Chicago. He is probably a descendant of Sudanese slaves, is married to an American and now heads the Office of Antiquities. Many Americans regard him as the most perceptive and articulate sociologist in the kingdom.

"The Ulemas (the religious scholars) will guard this life-style," he says. "So far the western impact on our life has been superficial. My serious judgment is not to believe that the people are feeling threatened with the loss of tradition. There is no bewilderment about the basis characteristics of their lives, such as the impact of the women's movement. If western influence was so ominous a sign of change, we would readily have seen a tremendous change in the sexual division of labor. It has not happened."

Another Saudi intellectual, a product of western univerities, is Hisham Nazir, the minister of planning. He sees change ahead.

"Nothing in Islam," he says wryly, "prohibits women from working or learning. We have people who object to music. Even the national anthem."

AN OBVIOUS question is: What do Saudi women think and say about all this?

An obvious answer in Saudi Arabia is that western men, journalists included, do not go around talking to Saudi women. One of the richest women in the country, encountered at a diplomatic affair, is Mrs. Gaeth Pharoan, whose airy view is that "Saudi women like it this way."

Saudi men, taking the same view, say that women vote with their feet, meaning that virtually all the young women sent abroad to study return home to take their traditional places in society.

"Why not?" asks one. "They have full economic independence. They can own property. They keep their maiden names when they marry. They have security. Whats wrong with that?"

The trouble with all these forecasts of the future is that Saudi Arabia has not yet found its place in the 20th century. It is a society in transition, a society, as someone has said, that is "trying to go from the camel to the Concorde in a single generation."

There are now 500,000 girls in the young Saudi educational system.

There are demands for workers in the country which the all-male Saudi labor force cannot meet by any stretch of the imagination. The country has been forced to import nearly 1.5 million foreign workers and another 500,000 or more are likely to be recruited in the months and years just ahead.

Of perhaps greater import for women is the rapid decline of the extended family here. When the population was found primarily in the desert and in the agrarian villages, the family was the beginning and the end of all life. But now the people are moving to the cities to buy or rent small houses and apartments. The extended family relationship cannot continue in such an enviroment and is rapidly being replaced by the nuclear family unit. This, in itself, is bringing a whole new way of life.

PEOPLE IN the West are prone to pass harsh judgment on alien ways. A character in a John LeCarre novel symbolizes that tendency:

"That's the trouble today. Like Africa. Nobody seems to understand you can't build society overnight. It takes centuries to make a gentleman."

The Saudis, secure for now in their customs and beliefs, have their own record of arrogance to aliens. An Arab geographer in the 10th century reflected on the barbarism of Western Europe:

"The peoples of the north are those for whom the sun is distant from the zenith . . .cold and damp prevail in those regions, and snow and ice follow one another in endless sucession. The warm humor is lacking among them; their bodies are large, their natures gross, their manners harsh, their understanding dull and their tongues heavy . . .Their religious beliefs lack solidity . . .Those of them who are farthest to the north are the most subject to stupidity, grossness and brutishness."

In that, you have the perspectives of East and West.