Prolua is a simple Lua 5.1 interpreter written in Prolog. Check out the documentation [PDF] for more details.
Prolua requires SWI-Prolog. Additionally, Prolua requires a Lua interpreter (lua) and compiler (luac) that implement the 5.1 specification, a current version of which can be found here. The interpreter is used to run the lua2prolog.lua script which generates an abstract syntax, while the compiler is used solely to check for any syntax errors in a Lua script.
Prolua has not been tested with Lua programs that adhere to the 5.0 specification or less and as such, I cannot guarantee they will work in Prolua. Since Prolua currently implements the 5.1 specification, Lua scripts using features introduced in 5.2 and later will not work.
To run the interpreter, simply execute the prolua.sh script from a terminal. The script takes one or more arguments with the first being the name of the Lua program to interpret, and the rest being command line arguments passed to said program. An example of execution would be
./prolua.sh samples/assignment.lua
Prolua is developed under Debian GNU/Linux and the prolua.sh script is written to work with bash. This means that it won't work under Windows but should, theoretically, work under any Unix-like operating system (e.g. Mac OS), provided the stated requirements are met.
The folders provided with this software are structured in the following manner:
- samples contains sample Lua source code files used to test Prolua.
- src contains the source code tree.