Published on Let's Talk Development

The butterfly effect of industrial policy in Brazil

This page in:
1st generation old computer. | © Lorenzo Herrera / Unsplash The creation of the programming language Lua can be traced back to a 20-year-long experiment in Brazil. | © Lorenzo Herrera / Unsplash

How can a programming language born from sheer necessity rise to global prominence? The story of Lua, a lightweight programming language that has gained worldwide influence, is a fascinating tale of the journey from a Brazilian innovation effort at the Pontifical Catholic University of Rio de Janeiro to the global stage of technology. This journey, which begins under the shadow of restrictive domestic protection and ineffective industrial subsidies in Brazil, unfolds with an intriguing twist: the pivotal role of Facebook, a global tech giant, in promoting Lua's use at a global scale. This is a revealing story about innovation today: local creativity often requires global market forces to realize its full impact, and global companies depend on the diversity emerging from countries with vastly different experiences and geographies to push forward the boundaries of global technology.

The creation of Lua can be traced back to a 20-year-long experiment in Brazil, initiated by a policy of strong trade barriers for computer hardware and software starting in 1977. This policy, known as the market reserve, was predicated on the belief that Brazil could and should produce its own technology to foster national development (Brazil’s Prickly Computer Policy). Meanwhile, mathematician Edward Norton Lorenz had introduced the concept “Butterfly Effect” in his famous article “Predictability: Does the Flap of a Butterfly's Wings in Brazil Set Off a Tornado in Texas?” Lorentz was thinking about a weather event as an example for his theory about mathematical unpredictability. It was not a butterfly in Brazil, rather, an industrial policy that created an unpredictable storm many years later in the tech world.


Brazil and the birth of machine learning

The period of protectionism in Brazil set the stage for an unexpected development in the tech world. In 1993, four researchers at the Pontifical Catholic University of Rio de Janeiro unveiled a new programming language called “Lua”, meaning “moon” in Portuguese. Lua emerged as a practical solution to the market reserve policy's constraints, which left clients without access to foreign software. The language was crafted to be intuitive and script-based, ideal for experimentation and lightweight mathematical applications.

A decade later, far away from Brazil, a group of computer scientists in Lausanne, Switzerland, developed “Torch”, a mathematical library utilizing Lua for its flexibility and convenience over other options at the time. Torch provided a toolkit for implementing Machine Learning (ML) algorithms, predating other currently popular libraries by more than ten years. At a time when ML was still a fledgling field, Lua and Torch significantly propelled ML research forward, thanks to their open-source, free, and adaptable nature.


The role of globalization in realizing the full potential of local innovations    

Fast forward 10 more years to 2013, and enter Facebook, a behemoth of global technology. The company’s decision to invest in ML and adopt Torch as its main platform marked a turning point for Lua. Facebook’s endorsement not only validated the significance of Lua's innovation but also showcased the indispensable role of global market forces in amplifying its capabilities. Lua’s integration into Instagram's infrastructure catapulted the programming language onto a global stage. This transition from a local solution developed under Brazil's protective industrial policy to a critical component of a global tech giant's operations exemplifies how the successes of such policies can be intricately tied to globalization. Without the globalized market for technology and the mechanisms for intellectual property integration into larger, international entities, the story of Lua might have been markedly different.

Unfortunately, Lua’s story of success abruptly ended in 2017 by Facebook’s decision to drop Lua and port Torch to other platforms. However, current ML technologies would not be possible without Lua as there were no other programming languages better fit for the task at that time. For this reason, Brazil’s Lua will remain a well-respected hero in the history of mathematical computing.


What is the right policy?

The tale of Lua and Facebook shows an essential truth about innovation in the modern world: local ingenuity needs global pathways to achieve widespread impact. The industrial policy that nurtured Lua's creation provided a unique—albeit costly––environment for innovation, but it was the language's entry into the globalized market, propelled by Facebook’s strategic decision to support it, that unlocked its true potential. National policies may spark local innovation, but it is the global marketplace where these innovations achieve their ultimate expression and value.

What would happen if Brazil had not banned import of computer software in 1970s? What would be the current state of AI technology? We can only speculate. While happy accidents do occur, this does not mean that Brazil’s ban of software imports in 1970s was the optimal policy at that time. Apart from this anecdote, it is not easy to find success stories related to Brazil’s computer market reserve policy. Economists Luzio and Greenstein estimated a consumer surplus loss of about 20 percent of expenditure in computers, and no quantifiable improvement in local technologies. The Lua experience shows, however, that there is an amazing human capital potential in developing countries that is not utilized effectively. The optimal policy is to connect them to the world rather than isolate them. 

Daria Taglioni

Research Manager, Trade and International Integration, Development Economics

Join the Conversation

The content of this field is kept private and will not be shown publicly
Remaining characters: 1000