Tanzania is celebrating both the 10th anniversary of adopting a socialist economic program and the birth of a new political party today.

By the latter step, the country's leaders hope to solidity the stormy 13-year-old union between the mainland and the spice islands of Zanzibar and rekindle a political enthusiasm that has burst out during years of economic hardship.

Despite the imagery of the torch-carrying Tanzanian youths running like Olympians through the streets of Arusha and the politicians' proclamations of democracy and socialism in Zanzibar. Tanzania has failed to establish a viable agricultural economy or to bring autonomous-minded Zanzibar into step with the rest of the nation.

The celebrations are marred by a steadily worsening row with its neightbor Kenya. Tanzania cut off all contacts with Kenya yesterday, sealing its borders and stranding hundreds of foreign tourists who must return to Nairobi to catch homeward flights. Each country has blamed the other for the collapse of East African Airways, which went bankrupt and ceased operations last week.

Although President Julius Nyrere candidly admits that "in reality we are neither democratic nor socialist," water, education and health care to backward rural areas and to eliminate the gap between the rich and poor, urban and rural.

Nyrere, a devout Catholic who plows his own garden with an ox, has a reputation for honesty and determination.

"But what has he accomplished?" asks a Norwegian expert who helps manage farmer's cooperatives in western Tanzania.

Aware of their economic backslideing, many Tanzanians believe the country is now at a crossroads. "Nyrere's idealism just hasn't worked," said one intellectual. "We must choose between going the full route and accept disciplined Marxism like our brothers in Mozambique or else restore individual production incentives and encourage private initiatives."

He would prefer the thorny Marxist route, but Finance Minister Amir Jamal has recently criticized the trend of driving efficient small-scale private producers out of business.

Last year, even President Nyrere had to call a halt to his program of redistributing private shops to cooperative groups after many shops ran out of soap, matches and other basic commodities when they were taken over by inexperienced collectives.

At this point it is unclear if Tanzania will opt for Communist orthodoxy, an idea popular with only a small minority of intelligentsia, or an increased tolerance for private ventures, but there has been a halt to the "ujamaa " plan that has already assembled 9 million of the country's 15 million people in socialist villages.

Popular resistance to "ujamaa ," the backbone of Nyrere's rural development campaign, coupled with prolonged droughts in the early 1970s, has led to sharp declines in agricultural production. Food imports in a country that relies almost totally on agricultute and is listed by the United Nations as one of the world's poorest have practically bankrupted the country.

To the relief of many Tanzanians, new village plans are allowing peasants to farm privately.

The idealistic spirit and self-reliance embodied in the Arusha declaration of socialism which was approved exactly 10 years ago made Tanzania a darling of many in the international community.

Many Westerners considered Nyrere's utopian form of "African socialism" the boldest social experiment on the African continent, while the Eastern bloc was eager to help the country disentangle itself from its colonial ties to the capitalist West and strive for economic democracy in a classless society.

"Instead of before, when some of us were rich and even the poor ones could hope for better days, now we all suffer togerher," sai done Tanzanian of Pakistani descent, who had three buildings nationalized in the government's fairly successful crusade aginst local capitalists.

It is equalization of wealth that still draws praise for the socialist experiments, but rather than the rich and poor finding a common standard somewhere in the middle, the whole country seems to have sunk from the euphoria of a decade ago into a collective state of poverty and gloom.

"I remember when there were only a few people who could afford to buy butter and cheese," say one long-time Canadian missionaty, "but now there is simply no butter or cheese to buy." One reason is that many of the most successful farms, both in the peasant and modern sectors, have lost all incentive to produce.

A once-prosperous modern dairy farmer in Iringa district, who has now taken a job as a farm manager in neighboring Zambia said, "Almost all of the modern farmers left when the government ordered us to join ujamaa villages."

In Zanzibar, which merged with the mainland in 1964 after a bloody revolution that overthrew the island's Arab overlords, ujamaa has never been tried. The people there have protectively guarded their judicial, political and economic autonomy.

Since Zanzibar's brutal dictator, Abeid Karume, was killed in an attempted coup in April 1972, the island has moved politically closer to the mainland.

This growing national unity is being celebrated today as the Zanzibar political party founded by Karume merges with Nyrere's TANU to form the Revolutionary Party.

Hundreds of dignitaries from around the world, including the new U.S. ambassador to the United Nsations, Andrew Young, are joining the festivities.

Nyrere, however, has said he is growing weary of trying to walk a tighrope of union with Zanzibar, create a socialist state and lead the African front-line presidents in their efforts to bring black-majority rule to Rhodesia.

Karume's successor, a mild-mannered former school teacher named Aboud Jumbe, appears to enjoy Nyrere's confidence and has spent much of the last year touring ever corner of mainland Tanzania.

If Nyrere follows his plan and steps down as president in 1980. Jumbo would appear to be a likely successor.

Nyrere says he wants to devote himself to grassroots political organization and work directly with his countrymen.