CS 4536, Programming Languages
C Term, 2012
Prof. Joshua D. Guttman

Email: last name@wpi.edu
Office: FL 137

Class meetings: Lower Perrault Hall, T F, 1-2:50


Getting Lua
Learning Lua



Programming Language: Lua

Some of the programming projects will be done using Lua. Lua is a very simple programming language, designed to allow the maximum computational content to be expressed with a minimum of syntactic clutter and verbosity. It is a procedural language like C and Java, but has excellent support for recursion and higher-order functions. In this regard it is as good as Scheme.

A recent survey of the popularity of programming languages from TIOBE reports this month (October 2011) that Lua has surged in popularity during the past year. It has risen eight positions, and is now 16th in popularity.

How to get Lua

You can download Lua for the main types of system here, and Windows users often like Lua for Windows. You may use either Lua version 5.1.4, the current stable version, or the newly released version 5.2.

Windows users often like to use the Scite editor, and Macintosh users often like TextWrangler. Both are freely available, and easy to find by googling. I like Emacs, using the lua-mode available on the web. It gives excellent support for running Lua interactively as a subordinate process under Emacs.

I will put three copies of the Lua Reference Manual on reserve in the library, but I mainly use the online version. They have a very nice book on Programming in Lua. The version that's free on line is not 100% up-to-date, but it is totally adequate for the parts of the language we'll use in this course.

Learning Lua

We will use only the core of Lua. That should make it easier to master the part that matters to us now. If you find Lua useful, you may want to learn more later. And in fact it can be very useful, since it has good, platform-independent access to system resources; since it is easy to embed into programs written primarily in other languages such as C, and vice versa; and since it's convenient for user configuration.

I will schedule Lua Labs early in the term, and I will write up a small guide to Lua.

Lua Labs:
Before coming to a Lua Lab, please download and install Lua on your system. It's available here. Please also retrieve and save the files init.lua and programs/sorting.lua. That will give you a starting point. If possible, try to run those files, and add a few examples. Lua labs are currently scheduled in FL 137 for:
  • 17 Jan, 3:00 -- 4:00
  • 19 Jan, 10:00 -- 11:00
  • 19 Jan, 1:00 -- 2:00