After years of paralyzing economic crises that put Turkey on the brink of bankruptcy, optimisim about the future is an exercise in relativity.

But deep into the hot Anatolian summer, officials and diplomats here in the Turkish capital are cautiously hopeful. At least, they all seem to agree, the economic doomsday that threatened the very existence of Turkey last winter has receded for the immediate future.

Behind such optimism are such implausible indicators as the fact that today Ankara residents are blessed with two-hour power and water shortages a day, four days a week.

To appreciate the upbeat nature of such a seemingly depressing fact, it is necessary to be reminded that only a few months ago, when the freezing breath of one of Turkey's worst winters in ages was blowing across a land where heating fuel was often unavailable, the power and water shortages were four hours a day, six times a week.

Another key indicator is that inflation today is running at about 60 percent. The silver lining in that alarming statistic is that a year ago it was more than twice that.

There still is not any Turkish coffee in the city's sidewalk cafes, but officials point proudly to the fact that the winter's snaking car lines at gas stations have disappeared and heating fuel is promised by the time the thermometer plunges again.

These improvements are the first tentative results of the draconian economic reform program announced by Premier Suleyman Demirel last January. eAt that time, the coffers of the Turkish Central Bank were so empty that the bank director himself had to telephone European bankers to plead for $10 million for vital oil shipments already on the high seas.

Formulated by Demirel's chief economic adviser, Turgut Ozal, the reforms thrust on Turkey's stagnant, cumbersome, inefficient state-supported economy, are, in the words of one Western economist, "very bold, very sweeping, and in Turkish terms, very revolutionary."

The reforms envisage the total transformation of the economy from the traditional system of import substitution, high tariff protectionism for Turkish industries, and massive state subsidies for overstaffed and under- productive state enterprises coupled with stiff banking controls, official props to the national currency and rigid curbs on foreign investment.

Ozal's plans call for the opening up of this protected and artifical economy to the natural forces of the market place -- something that flies in the face of the legacy left by Kemal Ataturk, the founder of modern-day Turkey.

Under Ozal's reforms the lira has been successively devalued over the past six months. Restrictions on foreign investment were lifted and steps have been initiated to facilitate it. Federal subsidies to bloated state industrial monopolies were slashed by a fifth from last year's $5 billion. Prices of many goods tripled overnight.

Economists here say it is still too early to judge whether these measures will have the desired effects of boosting Turkish exports abroad -- considered imperative if the economy is to be revived -- or raising industrial productivity, which has often languished at 30 percent of capacity.

What Demirel's measures did do, however, was give much needed reassurance to Turkey's worried allies about the nation's willingness to try to arrest its seemingly inexorable slide into bankruptcy.

If Demirel's measures have as yet only scratched the surface of the problem, what they have done without a doubt is prompt concerned Western nations to cough up more than $3 billion in aid and debt relief this year. The money is meant to give the country a financial breather until it can be seen whether the reform measures will breathe new life into the economy.

Having given Turkey $900,000 late last year as an emergency sweetner, the International Monetary Fund rewarded the country for following its stringent deflationary recommendations by putting up another $1.6 billion for balance of payment relief over the next three years. That was followed by a pledge from the 24-nation Organization of Economic Cooperation and Development of another $1.16 billion loan for this year. Late last month the OECD also agreed to lighten the load of Turkey's $16 billion national debt, by agreeing to reschedule official debt repayments totaling $3 billion.

This windfall of money will assure Turkey's ability to meet, among other things, its $3 billion fuel import bill, which last year was the single biggest drain on Turkey's foreign currency reserves.

Although Turks may not get their cherished cups of thick sweet coffee for a long time yet, the likelihood of their shivering through another near fuelless, powerless and waterless winter this year seems to have been averted.

The most immediate unanswered question remains the extent to which Demirel, a notorious political animal, will adhere to some of the most unpopular reform measures at a time when he is clearly maneuvering toward snap national elections this fall to capitalize on the program's meager effects so far.

Though much of Turkey's economic mess goes back to Demirel's own failures while in power between 1975 and 1977, he has sought to obscure that by blaming Bulent Ecevit, the chief opposition leader. Ecevit succeeded Demirel as prime minister in 1977 and remained in office until last fall when Demirel formed a minority coalition among his Justice Party and two small extremist parties of the right.

Demirel currently is seeking an agreement with his coalition partners to call new elections. He senses that Ecevit's Republican People's Party, the Justice Party's main political rival over the past couple of decades, is split and in a period of decline.

With these elections in veiw, Demirel is seeking to revise his agreement with the IMF on credit expansion to loosen up the present tight money market. Accomplishing that would hardly hurt his electoral chances.

Economists here are worried about other signs that politics is intruding once more on economic good sense. Demirel quietly increased support prices to farmers recently in what one economist termed "a move of pure politics with nothing whatsoever to do with economics."

Contracts for 100,000 jobs are also being renegotiated and the temptation for a politician like Demirel clearly is to forget his concern about inflation in favor of influencing votes. With unemployment already nearly 30 percent, a round of price hikes would do Demirel no harm with the labor vote.

Because of this, economists are not yet breathing a sigh of relief over Turkey's economic situation. Demirel's measures -- if he sticks to them -- and the foreign loans they shook loose have brought the country much needed short-term relief. The long term, however, remains every bit as problematical, especially if Western donor governments find the present level of economic support cannot be sustained indefinitely.

"Demirel has won an economic battle," said one NATO nation diplomat here. "It remains to be seen if he can, or will, win the war."