Keynote speakers

Roberto Ierusalimschy
Departamento de Informática, PUC-Rio, Río de Janeiro, BrazilFunctions in Lua
Abstract
First-class functions are a hallmark of functional languages, but they
are a useful concept in imperative languages, too. Even ISO C offers
a restricted form of first-class functions (in the form of pointers
to functions), and several more recent imperative languages offer
first-class, anonymous functions with lexical scoping.
In most imperative languages, however, first-class functions are an
advanced feature used by seasoned programmers. Lua, by contrast,
uses first-class functions as a building block of the language.
Lua programmers regularly benefit from diverse properties of its
functions for routine constructions such as exception handling, module
definitions, and object-oriented programming. Moreover, first-class
functions play a central role in the API between Lua and C.
In this talk, we will discuss some aspects of Lua that were designed
with first-class functions in mind, in particular its module system,
exception handling, facilities for object-oriented programming, and
the API between C and Lua. We will see how those different aspects
of Lua use different properties of first-class functions to achieve
two important goals in the design of Lua, namely small size and
embeddability. We will also discuss how Lua reconciles closures with
an array-based call stack, the runtime model favored by imperative
languages.