Spain is in a complete economic crisis. Its unemployment rate of 24.4 percent is higher than the U.S. unemployment rate during the worst of the Great Depression. And there’s no Spanish New Deal waiting around the corner to turn things around. The prolonged spell of mass unemployment is going to degrade workers’ abilities and prevent young people from gaining skills. The most capable and daring Spaniards will emigrate abroad, and Spanish firms will (rationally) fail to invest in improving the productivity of their workers. This bleak outlook will make investors more reluctant to loan euros to the Spanish government, which will then force more rounds of tax hikes and budget cuts, which will further crush the Spanish economy. A country that was booming a few years ago now looks doomed.

But perhaps there is a way out, one suggested by the recent experience of Argentina, a nation that’s currently enjoying full employment.

Spain and Argentina faced essentially similar problems. Both emerged from dictatorship with reputations for pleasant climate, good food, fun people, bad macroeconomic management, and low productivity. And after floundering a bit, both hit upon a similar solution: outsourcing macroeconomic management.

Argentina’s strategy was a currency peg, a firm commitment enshrined in law that Argentine pesos would always be exchangeable at a fixed rate with American dollars. Spain’s strategy was to join the euro, technically a joint project of all member countries but universally understood as a way for countries like Spain and Italy and Portugal to sign up for German-style macroeconomic management. To underscore the point, the European Central Bank was located in Frankfurt, home of the German Bundesbank, rather than in the European Union capital of Brussels.

In both countries it worked. Nothing about the currency peg in Argentina or the currency union in Spain changed the basic structure of either country’s middling economy. Their industrial bases were still second-rate, their service sectors inefficient. Still, basic monetary stability plus a good climate and an accessible European culture can go a long way. The currency unions sparked investment booms, as foreign capital poured in, boosting employment and wages. Three cheers for stability.

But when the world economy hit a snag in 2001, trouble emerged for Argentina. Unrelated hidden risks were revealed elsewhere in the global investment landscape and everywhere people got nervous. The foreign capital began to abandon Argentina, reducing investment, employment, and incomes. This in turn sharply reduced the Argentine government’s tax revenues and led to calls for sharp budgetary consolidation. Tax hikes and spending cuts, however, further weakened Argentina’s domestic demand and exacerbated the social crisis. In December of 2001, things came to a head. The IMF refused to release previously agreed-upon bailout funds, arguing that Argentina was welshing on its fiscal commitments. Protesters and rioters took to the streets. President Fernando de la Rua’s party took a beating at the polls. Argentina defaulted on its external debt, broke the rigid linkage between the peso and the dollar, and went back to pursuing an independent monetary policy.

Flash-forward 10 years, and you can see plenty of cautionary lessons in the Argentine default experience. Cut off from international financial markets, the government had no choice but to live within its means. With the value of the currency plummeting, Argentina households had no choice but to shift away from importing things to spending on locally produced goods or services. Foreigners suddenly found Argentine stuff cheap, so exports and tourism soared. This is how austerity is supposed to work. Your society consumes less, but produces more.

Default and devaluation were hardly a party. They destroyed the country’s banking system and wiped out many Argentines’ savings. But it did work. Argentina has grown rapidly in subsequent years and its unemployment rate has fallen steadily to 6.7 percent, a rate we envy in the United States.

That’s hardly a panacea. The abandonment of the dollar peg has cemented Argentina’s reputation as a bad place to invest your money. The governments of Nestor and Cristina Kirchner have pursued a series of dubious energy policies, and give off a strong air of dynastic cronyism. For all our problems, America is much richer and enjoys much better institutions than Argentina and there’s no substitute for good institutions.

So what’s the lesson for Spain? Piggybacking on the dollar ultimately failed Argentina, because pegging to the dollar didn’t suddenly turn Argentina into the United States. Similarly, adopting macroeconomic policies made in Frankfurt and Berlin doesn’t give Spain Germany’s fundamentals, it just saddles Spain with policies that are designed for Germany. A full monetary union is not the same thing as a currency peg, and unwinding the euro would wreak even more short-term havoc than Argentina’s default. But an economically sovereign country at least has the opportunity to get things right, while a country shackled to another nation’s macroeconomic policies is basically left hoping for charity. If officials in Spain and elsewhere aren’t considering the possibility of quitting the eurozone, they should be.