Decoding Lua: Formal Semantics for the Developer and the Semanticist

06/07/2017
by   Mallku Soldevila, et al.
0

We provide formal semantics for a large subset of the Lua programming language, in its version 5.2. We validate our model by mechanizing it and testing it against the test suite of the reference interpreter of Lua, confirming that our model accurately represents the language. In addition, we set us an ambitious goal: to target both a PL semanticist ---not necessarily versed in Lua---, and a Lua developer ---not necessarily versed in semantic frameworks. To the former, we present the peculiarities of the language, and how we model them in a traditional small-step operational semantics, embedded within Felleisen-Hieb's reduction semantics with evaluation contexts. The mechanization is, naturally, performed in PLT Redex, the de facto tool for mechanizing reduction semantics. To the reader unfamiliar with such concepts, we provide, to our best possible within the space limitations, a gentle introduction of the model. It is our hope that developers of the different Lua implementations and dialects understand the model and consider it both for testing their work and for experimenting with new language features.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/28/2018

KRust: A Formal Executable Semantics of Rust

Rust is a new and promising high-level system programming language. It p...
research
07/11/2019

Executable formal semantics for the POSIX shell

The POSIX shell is a widely deployed, powerful tool for managing compute...
research
05/03/2020

Certified Semantics for Relational Programming

We present a formal study of semantics for the relational programming la...
research
09/23/2022

Formal Semantics of the CDL Language

We reverse-engineer a formal semantics of the Component Definition Langu...
research
08/16/2018

Formalisation of a frame stack semantics for a Java-like language

We present a Coq formalisation of the small-step operational semantics o...
research
10/17/2021

Semantics of Conjectures

This paper aims to expand and detail the notion of formal semantics of C...
research
01/31/2022

A Formal Model of Checked C

We present a formal model of Checked C, a dialect of C that aims to enfo...

Please sign up or login with your details

Forgot password? Click here to reset