CSci 658: Software Language Engineering
Fall 2013
Syllabus (Modified 10 October)


Locations

The fall semester 2013 class meets in 235 Weir Hall at 4:00 p.m. to 5:15 p.m. on Tuesdays and Thursdays.

The class is taught by Prof. Conrad Cunningham, whose office is in 203 Weir Hall. The official office hours for this class are 1:00 to 2:30 p.m. on Mondays and Wednesdays and by appointment at other times.

Prof. Cunningham's voice telephone number is (662) 915-5358 and fax number is (662) 915-5623. His WWW home page is http://www.cs.olemiss.edu/~hcc/ and his email address is cunningham ATSIGN cs DOT olemiss DOT edu.

The WWW home page for this class is http://www.cs.olemiss.edu/~hcc/csci658/.

The final examination for this class is scheduled for Wednesday, 11 December at 4:00 p.m..

Student Disabilities Services Statement

"It is the responsibility of any student with a disability who requests a reasonable accommodation to contact the Office of Disability Services (915-7128). Contact will then be made by that office through the student to the instructor of this class. The instructor will then be happy to work with the student so that a reasonable accommodation of any disability can be made."

Course Description from Catalog

Study of topics on the design, implementation, use, and evolution of artificial languages for the engineering of software. Languages of interest include general-purpose programming languages, domain-specific languages, and modeling languages as well as application programming interfaces and collections of design patterns that implicitly define languages.

Prerequisites

Graduate standing in computer science

Course Outcomes/Objectives

Upon successful completion of this course, students:

  1. know and understand the fundamental concepts and techniques of the Lua programming language
  2. can analyze a problem and synthesize a solution using functional programming techniques in Lua
  3. (added) know and understand the concepts and techniques of data abstraction and can incorporate them into Lua programs
  4. know and understand the concepts of tables and metatables and can implement modules and object-oriented programming facilities in Lua
  5. (added) know and understand the concepts of domain-specific languages (DSLs) and can apply basic techniques for implementing internal DSLs in Lua
  6. know and understand the basic concepts of parsing expression grammars and the LPEG library and can use the library to implement simple languages
  7. know and understand the structure of interpreters and can modify or implement interpreters for simple languages
  8. (removed, not enough time) know and understand the concepts of coroutines and can implement "concurrent" programs in Lua

Motivation

Linguistic abstraction is at the core of computing science. As computing scientists, we should be able to solve problems and express the solutions in a variety of programming paradigms. We should understand how programming languages work. We should be able to design and implement simple languages to assist us in our work.

This course seeks to deepen our understanding of the concepts and techniques for the design, implementation, and use of programming languages. It uses the dynamic application programming language Lua as both an object of study and a tool for implementing languages.

Lua is appropriate for this purpose. Its developers want to keep the core language simple but enable users to extend it by adding new features via host language (e.g., C) libraries. They also want to enable users to embed Lua functions and programs within host language applications. They want Lua to have an implementation that is small, efficient, and portable.

To help achieve these goals, the Lua developers adopted the principle of separating mechanism from policy. That is, Lua provides "meta-mechanisms for implementing features, instead of providing a host of features directly in the language" [http://www.lua.org/about]. For example, Lua is not natively an object-oriented language, but its first-class functions, tables, and metatables enable several different implementations of classes and inheritance. We can study these different techniques--and perhaps design our own--to get a concrete understanding of how object-oriented languages work.

Although Lua is primarily a procedural language, it supports programming in multiple paradigms. Its lexically scoped, first-class functions (closures) and tail recursion (tail call) elimination enable functional programming. Its closures, tables, and metatables enable both modular programming and object-oriented programming implementations. Its closures, first-class coroutines, and generic-for construct enable goal-directed programming. Its coroutines enable cooperative (nonpreemptive) multitasking natively. In combination with host language thread libraries, its coroutine and state maintenance facilities enable a variety of "shared-nothing" concurrent programming approaches to be implemented.

Lua also supports language-oriented programming by means of its add-on LPEG text-processing/parsing library. LPEG provides a set of composable operators to parse languages defined by parsing expression grammars. This library is efficient and subsumes the functionality of regular expression processors. But it supports parsers for a class of languages similar to those definable by context-free grammars. Thus LPEG should enable the processing of small languages such as external domain-specific languages (DSLs).

Lua should thus be effective for processing the simplified languages used in interpreter-based approaches to programming language organization courses. These languages are often Lisp-like languages using parentheses to specify the structure of the program expressions. We can use the implementation of such languages to help us explore programming language design and implementation concepts.

Samuel Kamin's textbook Programming Languages: An Interpreter-Based Approach (Addison Wesley, 1990) examines a variety of programming languages by first building an interpreter for a core Lisp-like language and then modifying it to process languages with a similar syntax but differing semantics (meaning). Although Kamin's languages were implemented in Pascal and C (and later in C++ by Timothy Budd), the instructor recently developed a prototype of Kamin's core, Lisp, and Scheme language interpreters in Lua using LPEG to build the parser. We can use this implementation (and others we may build) to study key concepts of programming language design and implementation.

Source Materials

Selected Course Textbook:
Roberto Ierusalimshcy. Programming in Lua, Third Edition, Lua.org, Rio de Janiero, 2013.
(The bookstore may not be stocking this course. You can buy from Amazon for less than $30.)

Software:
Lua 5.1 (mostly) or 5.2 (Some of the software we use may not yet work on the 5.2 versions of the interpreter.) You can download from http://www.lua.org or various other repositories.

Readings:
Various journal and conference articles, research reports, Web documents, and book excerpts as appropriate. For example, see the Lua website http://www.lua.org for some references.

Course Topics

The course is expected to cover most of the following topics. Of course, this list is subject to refinement as the semester progresses.

  1. Fundamental Lua concepts
  2. Functions and closures
  3. Functional programming
  4. Tables and metatables
  5. Implementing data abstraction and modules
  6. Implementing object-orientation (classes, single/multiple inheritance)
  7. (Added) Internal domain-specific languages
  8. LPEG library and parsing
  9. Implementing simple languages
  10. (Not covered) Coroutines and iterators
  11. (Not covered) Concurrency

Professional Conduct

As a student in CSci 658, you are expected to conduct yourself in a professional manner according to the Honor Code of the School of Engineering, the Information Technology (IT) Appropriate Use Policy, the M Book, and any other relevant policies.

Limited Collaboration Policy. Unless otherwise indicated, any homework assignment or programming exercise given in this class will be an individual assignment. The work you submit is to reflect the knowledge, understanding, and skill that you have attained as an individual. However, the instructor does want to encourage the development of a community of scholars who are actively engaged in discussion of the ideas related to this course. With this in mind, you are allowed to discuss solutions of the homework and programming problems with other students if done so according to the following guidelines:

Grading

The grading scale for this class is A [90..100], B [80..90), C [70..80), D [60..70), and F [0..60). However, the instructor will be using the +/- grading scale, as appropriate, to provide more fine-grained grading within these ranges.

Modified 10 October. Thirty percent of the semester grade will come from the exam grade and seventy percent from the homework assignment/project average.

Assignments and Projects

Examinations


UP to CSci 658 root document?


Copyright © 2013, H. Conrad Cunningham
Last modified: Mon Dec 9 14:21:18 CST 2013