Small Languages in Brazilian Engineering Applications

Lua originated in Rio de Janeiro, Brazil, in 1993. Tecgraf, the computer-graphics technology group at the Pontifical Catholic University of Rio de Janeiro, developed software for industrial clients. Roberto Ierusalimschy, Luiz Henrique de Figueiredo and Waldemar Celes collaborated there on the language's design. Their respective backgrounds emphasized computer languages, mathematics and software tools, and engineering graphics applications.

Petrobras, Brazil's oil company, was an important partner. Engineers frequently needed to prepare strictly formatted input files for numerical simulators, and directly editing columns of numbers was error-prone. Another project, producing lithological-profile reports, required geologists to choose curves, positions, fonts and scales themselves. Lua first responded to these practical software-configuration and data-description needs; it was not created specifically for a game.

References: [3]

Combining the Needs of DEL and SOL

Tecgraf first designed DEL, the Data Entry Language, for data input, using a graphical interface to let users enter and validate parameters. As users requested conditionals and loops, purely descriptive settings were no longer sufficient. The report-generation project used SOL, the Simple Object Language, to describe objects and their properties and pass the information to a host program written in C.

In mid-1993, the team decided to meet both needs with a new language capable of describing data and writing procedures. It needed assignment, functions and control structures while remaining simple and usable on the different kinds of computers customers owned. SOL also means “sun” in Portuguese, so the new language was named Lua, meaning “moon”. The name is not an English acronym, and its letters should not each be expanded into a technical term.

References: [2] [3]

Entering Host Applications as a Library

Lua's early implementation was supplied to host programs as a C library. A host could execute Lua code, read and write variables, and register its own C functions for Lua to call. One common syntax could therefore serve different domains: engineering software retained specialized functions such as drawing or simulation, while users combined them through scripts without recompiling the entire application.

Celes had completed the first implementation by July 1993. Initially, lexical and syntactic analysis used lex and yacc to convert source programs into stack-based virtual-machine instructions, which an interpreter then executed. This separated language processing from particular machines and kept the implementation small. Early Lua successfully entered the data-entry and lithological-report projects and was subsequently adopted by more projects within Tecgraf.

References: [1] [3]

Using a Table for Both Data and Validation

The original 1994 paper gave a record-construction example: “t = @employee{name="john smith", age=34}”. This first created a table with name and age fields, then called the employee function to check fields or add defaults. Tables associated names with values, and programs could also use numeric indices, so records and lists did not need completely different internal mechanisms.

This notation with @ belonged to early Lua and should not be treated as modern-version syntax. It illustrated a central approach: configuration files could carry both structured information and necessary computation, with validation rules expressed through ordinary functions. The language retained general mechanisms while leaving industry-specific rules to application authors. This division reduced the need to invent a separate, incompatible small language for every program.

References: [1] [2]

The 1993 Implementation and the 1994 Public Version

By July 1993, Lua had a working internal implementation, later called Lua 1.0. It was used in Tecgraf's engineering projects but was not publicly released at the time. The team publicly presented early applications at a Brazilian software-engineering symposium that October. The year 1993 thus marks the language's formation and internal use.

In July 1994, the team released Lua 1.1 for download through a file-transfer service and, during this period, published a paper introducing its design and implementation. Lua 1.1 was the first public version; academic use was free at the time, while commercial use still required separate negotiation. Lua 2.1, released in February 1995, changed this to free use including commercial purposes.

References: [3] [2]

The Direction Established by Early Choices

Lua placed configuration, data description and user-programmable behavior in one language, allowing application developers to distinguish core technology from frequently changing configuration logic. The 1994 paper listed production uses including interface and object descriptions, data-entry validation and storage of graphics metafiles. These concrete tasks showed that its early value already extended beyond simply reading a few parameters.

However, the familiar features of present-day Lua were not all completed in 1993. In their 2007 language history, the designers placed later object-extension mechanisms, anonymous functions, full lexical scoping and coroutines in subsequent versions. Looking back at its beginning, the more accurate conclusion is that a small embedded language for engineering applications first solved problems using clear syntax, tables and a C interface, then gradually changed through real use, rather than possessing all its later capabilities from birth.

References: [1] [3]