It is only 8 p.m. here in the Malagasy Republic, but an eerie silence envelops this capital city clinging to 12 sacred hills of a former kingdom. One can almost hear the ambling of the dead ancestors who the residents fervently believe live among them.

Only barking dogs and croaking frogs, squatting in the rice and watercress paddies, split the silence of the dusk-to-dawn curfew imposed by the government of Didier Ratsiraka in early February after two days of clashes between university students and the Army left six dead and about 60 wounded.

The violence subsided as quickly as it cropped up. But not before it had demonstrated the political and economic strains that course uneasily under Ratsiraka's six-year-old socialist rule in this former French colony.

The fourth-largest island in the world, Madagascar -- the site of the Malagasy Republic -- is a place of beguiling beauty with a romantic and proud history. Captain William Kidd, the 17th century pirate, once terrorized its shores, and 100 years ago, before the French came and conquered, Queen Ranavalona Ii sent an envoy to president Chester Arthur in Washington to conclude a treaty of peace and friendship.

The descendents of the adventuresome Polynesian sailers and African slaves who first populated this Texas-sized island in the Indian Ocean have produced a unique culture and language.But 20 years after independence, they face problems not unlike those of their neighbors on the African continent 250 miles to the west.

Today a Malagasy can expect to live only to age 46. Only 45 percent of the 9 million islanders can read and write. Unemployement is rising, 88 percent of the work force is still in agriculture, and in 1979 the annual per capita income was only $275. The country, in the words of its president, is in an "economic crisis."

That was not what the young naval officer had in mind when in 1972 along with military colleagues, Ratsiraka overthrew the first post-independence government and set the island on a more nationalist and radical path.

First as the power behind the scenes and then at the head of his own government in 1975, Ratsiraka nationalized banks, insurance companies, export-import companies and oil refineries, including two owned by Esso and Caltex taken over without compensation. Between 1975 and 1980, the government's control of the economy rose from 13 to 75 percent.

"A pig farm in ruins." The small story last month on an inside page of Antananarivo's morning newspaper, Madagascar Matin, gave an insight into what became widespread under the new socialist management. The coastal city of Toamasina, the story said, once had two farms that produced enough ducks and pigs to supply the city and ships in port. But since 1972, "the two farms like the flame of a candle have slowly gone out and not there is nothign there but overgrown grass." The reporter noted how Toamasina always lacks either duck or pork.

Another bad sign: Once a rice-exporting country, last year Madagascar had to import 170,000 tons.

However, when an economic history of Madagascar is written, it will also tell how in 1979 the country's oil bill skyrocketed to soak up one of every four dollars the island spent abroad, how in 1980 it went up again by $100 million even though consumption went down, how drought decreased agricultural production and how the erratic world prices of coffee, cloves and vanilla, Madagascar's most important exports, brought less money to its coffers while prices of imports kept excalating.

As a result, Madagascar is broke and has gone to the International Monetary Fund for a bail-out loan.Meanwhile, Algeria has proved to be a worthy firend and guaranteed a credit line so Madagascar can at least buy oil for 1981. In the period of economic austerity that is to come, however, other imports will be cut even though shop shelves are already half bare.

"We know we are going to suffer and suffer a lot," one government official said. "We cannot give the people all they want. The IMF tells us we are better off than most African countries, but try and tell that to the people -- that they are lucky to live here rather than a Sahael country. They say, 'Damm you." They expect something better to happen each week, each month."

Compounding economic problems has been the unforeseen fruit of a noble experiment gone awry. In an effort to "democratize" university education, the government at great expense built regional university centers around the country. Enrollment grew from 5,000 in 1972 to 40,000 today, according to one senior government official.

Unfortunately, this expansion took place on a poor foundation and without enough teachers. Crowded classes, lack of materials and staff frustrated students. In addition, students were coming to university ill-prepared because of a government dirve to "Malagasize" education by requiring that secondary school classes be taught in Malagasy, although no textbooks existed in the islanders' language.

When the students went on strike with these grievances last November, professors joined them demanding better pay and working conditions. As it went on, the strike became a convenient hitching post for right-wing and left-wing offonents of the government.

When Moana Joana, a veteran nationalist leader and critic of the government, was put under house arrest by Ratskiraka early in December after calling for a general strike, the students had a hero, and politicization of the strike was complete. On Feb. 3, although negotiations were reportedly under way between the government and the students, riots broke out for two days.

In the face of these problems, enthusiasm for the government's socialist policies was waned.

"There is disillusionment because of the inefficiency, the lack of goods and the corruption," said one middle-class professional who nonetheless supports Ratsiraka's government.

"The revolution has sobered," said one foreigner living here.

Sober too, is the articulate 44-year-old steering his island through the buffeting tradewinds of these problems. Having a reputation as a sophisticated leader, Ratsiraka is a "man of action," according to one acquaintance.

His abiding task is to fashion a working consensus within the coalition of six leftist parties that make up the ruling Supreme Revolutionary Council. All other parties are banned.

In a January speech, Ratsiraka called the rice situation "inadmissable" and promised better management of government-run enterprises. During a recent conversation in his office, Ratsiraka unsmilingly pondered Madagascar's problems with a combination of frankness and defensiveness.

"I admit that there is bad organization. I admit that there are many people against socialism, or should I say the are not for socialism. I admit there is incompetence in many areas, just as there is in all countries of the world. But I contend that the main problem is the external factors."

Ratsiraka denied that these external economic problems were due to the fact that Madagascar is a socialist country. "Reagan spoke of a calamity in the U.S.," he said. "How is it that you find disorganization normal in Western countries and not in Madagascar? Countries that choose a capitalist way of development still have a crisis, for example, Brazil."

Asked if he thought the striking students had legitimate gripes, he said, "Of course, I had grievances too when I was a student, but I didn't call for the head of state to leave or for (French president Charles) de Gaulle to step down.

"Do you think this is a logical strike? It began with the students saying we don't have enough butter on the table in the morning. In an underdeveloped country. Then the professors say they are not paid enough, as if they don't know we are in an economic crisis. No, it's not a student strike.

"The people can do nothing against me if they don't have foreign help. The people of Madagascar believe in us. But all I can tell you is that it is not a subersive movement organized by socialist countries. Ask the CIA and the Western security service."