Pope John Paul II today ended the first papal visit to France in 176 years with an appeal against the misuse of science in such fields as genetic manipulation and dependence of the nuclear balance of power.

His call came in a major address at the headquarters here of the United Nations Educational, Scientific and Cultural Organizations.

It was in keeping with a visit primarily dedicated to denouncing the twin dangers of the loosening of morals and ethics in the name of progress and of excessive insistence of clinging to outmoded traditionalism.

The pope's four-day visit seemed to demonstrate his determination to use the extremes of left and right, which are particularly pronounced in the French church, as examples of what he wants the church worldwide to avoid as he steers it down a middle course.

Every step he took toward reconciliation with the left or the right was carefully balanced by a step back to set limits on the troubled and adventurous French church.

In perhaps the most explicit expression of papal reconciliation with the French Revolution, John Paul II hailed its ideals of liberty, equality and fraternity. He said they were steeped in the same ideals of Christianity, regardless of the anticlericalism of the revolutionaries.

But this updating in the expression of church social doctrine was carefully balanced with reminders that endorsement of priestly participation in struggles for social justice does not mean that John Paul will tolerate the tendency of French worker-priests to accept communist doctrines and tactics of social class struggle and hatred.

The fine line the pointiff was walking was illustrated by his participation Saturday evening in a mass in the Basilica of Saint Denis, the oldest Gothic-style cathedral but also the most militantly working-class church in the communist-controlled Red Belt around Paris.

In a striking ceremony, a jazz and voice band sang words that could have been lifted from the kind of Marxist-tinged theology of liberation the pope had condemned: "People struggling and suffering for a new world, arise. That world is in your hands. People hungering for justice, oppressed people, arise and cry out your hunger.Enchained people, slaves today, arise, stand up. You must break those chains."

The pope responded by taking up much of the rhetoric, repeating, for example, the slogan of the founder of the worker-priest movement, "A young worker is worth more than all the world's gold," emblazoned on a huge sign in front of the church.

Then, however, John Paul recalled his own experience as a worker and said, "The world of work should be the world of love and not the world of hate, the world of construction and not the world of destruction."

The pope's endorsement of the solgans of the French Revolution amounted to a direct rebuttal of the view of traditionalist church rebel Archbishop Marcel Lefebvre, who believes that those days are the source of modern world's troubles. Yet, John Paul expressed understanding for the traditionalist nostalgia for the use of Latin church services (the Tridentine Latine mass was banned by the Vatican Council), telling a crowd of young people he addressed that they should learn Latin. This remark drew numerous hoots and catcalls.

The pope warned French bishops, whom he addressed separately during his four-day, 23-speech marathon, against hasty popularizations of new theological arguments published in scholarly church journals. He explained that the bubbling of the French intellectual pot must be prevented from boiling over lest it burn less sophisticated believers.

The pontiff met separately with the leaders of France's main Protestant sects, the large Moslem worker community and the grand rabbi of France. Sources at his meeting with the rabbi said that he accepted the Jewish leader's benediction but that he refused to let the rabbi induce him to say anything that would involve taking sides on continuing the Camp David approach to Middle East peace.

The pope also managed to bring about the broadest display of French political ecumenism anyone could recall. Gaullists and Giscardists -- accepted the invation of President Valery Giscard d'Estaing to attend a reception for the pope at the Elysee Palace.

Despite the heavy turnout at such official functions, the faithful in general seemed to be distinctly less interested in personal glimpses of the new Polish pope than the large crowds of his previous trips to such places as Poland, the United States and Africa. Major efforts to turn a Sunday morning outdoor mass at Le Bourget airfield into a million-person rally fizzled -- fewer than 300,000 showed up.

Rain was obviously not the main factor since large numbers of special buses and trains ordered for the event beforehand had to be canceled for lack of interest. There was major publicity for the events, and it may have scared people off by describing the anticipated difficulties of moving around in the expected hordes. Even many of the faithful apparently preferred watching the blanket television coverage.

John Paul's last stop before leaving France was a visit to the shrine of St. Therese, the patron saint of overseas missions, in the Normandy city of Lisieux.There, he called on the faithful of France not to abandon their attachment to the tradition of sending young missionaries into the world. It was apparently his answer to the crisis of vocations in which fewer than 100 new priests are being ordained annually in France, the country the pontiff never tired of referring to as the eldest daughter of the church.

"France, eldest daughter of the church, are you faithful to the promises of your baptism?" asked John Paul at Le Bourget. "That," said the Catholic daily La Croix, "was the real question posed by this trip."