Est. 2007 Beginner

LIA

Linguagem Interpretada de Algoritmos: a Brazilian Portuguese pseudocode language, interpreter and stepping IDE built in Petrópolis in 2007 for teaching beginners to write algorithms

Created by Rafael Martins (Instituto Superior de Tecnologia em Ciência da Computação, Petrópolis, Brazil)

Paradigm Imperative, Procedural (structured pseudocode)
Typing Static, declared (inteiro, real, caractere, logico; multidimensional arrays declared with vetor or matriz)
First Appeared 2007
Latest Version No numbered release documented; presented October 2007

LIA, short for Linguagem Interpretada de Algoritmos (“Interpreted Algorithm Language”), is a small teaching language from Brazil. Its keywords are in Portuguese, and it is written in the “structured Portuguese” pseudocode style that Brazilian computing courses use to teach algorithms before students meet a production language. Rafael Martins presented it in October 2007 at the Instituto Superior de Tecnologia em Ciência da Computação in Petrópolis. LIA was more than a notation: it came with an interpreter and a graphical development environment, so pseudocode students would otherwise write on paper could run, step by step, on a computer.

Only a little is known about LIA. Its record consists of an 82-slide presentation and one program its author posted to the 99 Bottles of Beer collection. This page sticks to what those two sources show.

A note on the catalogue entry. The encyclopedia catalogue lists LIA as a 1984 concurrent research language that was commercial into the 1990s. Nothing found supports any part of that. Every trace of LIA dates from 2007, and it is a sequential teaching language with no concurrency features. The year on this page is 2007.

History & Origins

Brazilian introductory programming courses traditionally teach algorithms in a Portuguese pseudocode, often called Portugol, with keywords like algoritmo, inicio, se ... entao, enquanto ... faca and fim. Students usually write it on paper. Several tools have been built to make such pseudocode executable, and LIA is one of them.

The project’s presentation is dated “Petrópolis, Outubro de 2007”. It starts from first principles: what an algorithm is, ways of writing one (flowcharts, natural language, pseudocode), and how running an algorithm by hand differs from running it on a machine. It then covers machine, low-level and high-level languages, compilation versus interpretation, and the phases of a compiler. Only after that does it introduce LIA, as a package of five parts:

  1. the language itself, specified with an EBNF grammar;
  2. an interpreter;
  3. an integrated development environment;
  4. a manual; and
  5. a set of examples.

According to the slides, the implementation was object-oriented and was built “without the help of support tools”, which in context probably means no parser generators. The compilation and interpretation stages lived in a DLL, which the graphical interface called. The slides do not name the implementation language, give a version number or say how LIA was distributed.

On 21 December 2007 Martins submitted a LIA program to 99-bottles-of-beer.net. That site collects one song-printing program in each of well over a thousand languages, and it lists LIA as a “real language”.

Design Philosophy

LIA aims to keep the notation students already use for algorithms, rather than teach them a new syntax first. Programs read like the pseudocode in a Brazilian algorithms textbook, but they can be checked and executed. The IDE is built around watching an algorithm run, not only around producing output. That reflects the presentation’s focus: the gap between tracing an algorithm by hand and seeing a machine carry it out.

Key Features

Language

The presentation lists these elements of the language:

FeatureLIA keywords
Program header and bodyalgoritmo, inicio, fim
Basic typesinteger, real, character and logical
Arraysvetor or matriz (synonyms in LIA), with any number of dimensions, e.g. notas: vetor[1:3] de real;
Assignment<-
Decisionse ... entao ... senao ... fim_se
Multi-way selectionescolha
Loopspara ... de ... ate ... faca, enquanto ... faca, repita
Subprogramsprocedimento, funcao
Input and outputleia, escreva, escrevaln

escreva and escrevaln (“write line”) mirror Pascal’s write and writeln.

Example

This is Martins’s own LIA program from the 99 Bottles of Beer collection (December 2007). It shows the program header, a typed variable declaration, assignment with <-, and a while loop closed by fim_enquanto. Like many entries in that collection, its verses are only approximate:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
algoritmo LIA;
variavel
  i: inteiro;
inicio
  i <- 100;
  enquanto (i > 1) faca
    i <- i - 1;
    escreva(i, " bottles of beer on the wall,");
    escrevaln(i, " bottles of beer.");
    escreva("Take one down and pass it around, ");
    escrevaln(i-1, " bottles of beer on the wall.");
  fim_enquanto;
  escrevaln("1 bottle of beer on the wall, 1 bottle of beer.");
  escreva("Take one down and pass it around, ");
  escrevaln("no more bottles of beer on the wall.");
  escrevaln("No more bottles of beer on the wall, no more bottles of beer.");
  escreva("Go to the store and buy some more, 99");
  escrevaln("99 bottles of beer on the wall.");
fim.

Statements end with semicolons and the program ends with fim., both in the Pascal style that Portugol borrows from.

The development environment

The presentation describes a teaching IDE with:

  • a code editor with syntax highlighting and several files open at once;
  • step-by-step execution and breakpoints;
  • a symbol inspector for watching variable values;
  • a call stack view for following procedure and function calls;
  • a console window that keeps a history of input and output; and
  • the manual built into the environment.

Programs run in either of two modes, Padrão (standard) and Rápido (fast). According to the presentation’s comparison table, only standard mode supports step-by-step execution, breakpoints, symbol inspection and the call stack, while fast mode trades those for execution speed and lower memory and processor use. The table gives no timings, so how much faster the fast mode is cannot be said.

Evolution

The presentation’s conclusion mentions plans for “new versions”, but no later release, version number or public download has been found. As far as the surviving record shows, LIA’s whole public history fits within 2007: the October presentation and the December 99 Bottles entry. The presentation was later put on SlideShare, which is where it can be read today.

Current Relevance

LIA appears to be inactive. No source code, installer or manual is available online, and there is no Docker image. Brazilian students who want runnable Portugol today usually use other tools, such as VisuAlg or Portugol Studio. LIA’s interest now is as a well-documented example of the type: a one-person project that took a classroom notation and built a compiler front end, an interpreter and a debugging IDE for it.

Why It Matters

LIA belongs to a long Latin American tradition of teaching programming in the learner’s own language, the same tradition that produced Portugol and Colombia’s Lexico. Its emphasis on breakpoints, a symbol inspector and a call stack view, all aimed at people writing their first algorithm, reflects a common view in programming education: beginners learn more from watching their algorithm execute than from reading its final output. LIA is also a reminder that a short name can be misleading. Searches for “LIA” turn up an ISO arithmetic standard and a logic theory used by SMT solvers, and catalogues have attached a 1984 date and a concurrency label to a 2007 Brazilian classroom tool.

Timeline

2007
Rafael Martins presents LIA (Linguagem Interpretada de Algoritmos), with its interpreter and IDE, at the Instituto Superior de Tecnologia em Ciência da Computação in Petrópolis, Rio de Janeiro state, in October
2007
On 21 December, Martins submits a LIA version of '99 Bottles of Beer' to 99-bottles-of-beer.net, which lists it as a real language

Notable Uses & Legacy

Teaching introductory algorithms

LIA was designed to support beginners learning algorithm construction. Its presentation surveys algorithms, flowcharts and pseudocode before introducing the interpreter as a tool for writing and running them

99 Bottles of Beer collection

The author's December 2007 LIA program on 99-bottles-of-beer.net is one of the few public examples of the language's code

Running Today

Run examples using the official Docker image:

docker pull
Last updated: