CSci 658: Software Language Engineering
Fall 2013
Lecture Notes and Web Resources


Sections:


    Reference Materials

  1. Free online programming language textbooks and tutorials
  2. General Lua resources
    1. Course notes by Fabio Mascarenhas for a course based on the PiL textbook.
    2. Official Lua language site: [download ] [documentation]
    3. Lua users site: [wiki]
    4. Luarocks component site
    5. Lua Toolbox
    6. LuaMacro site
    7. Lua Snippets
    8. Tecgraf PUC-Rio Libraries and Tools for Lua
    9. Kepler Project
  3. Key Lua papers and talks
    1. Roberto Ierusalimschy's slides for "Small is Beautiful: The Design of Lua" [PDF slides]
    2. Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes Filho. "Lua--An Extensible Extension Language," Software Experience and Practice 26 #6 (1996) 635-652: [HTML]
    3. Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes Filho. "Passing a Language Through the Eye of a Needle," ACM Queue 9 #5 (May 2011) 20-29: [PDF]
    4. Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes Filho. "The Implementation of Lua 5.0," Journal of Universal Computer Science 11 #7 (2005) 1159-1176: [PDF]
    5. Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes Filho. "The Evolution of Lua," In Proceedings of ACM HOPL III (2007) 2-1--2-26: [PDF]
  4. (SICP) Harold Abelson and Gerald J. Sussman with Julie Sussman. Structure and Interpretation of Computer Programs, Second Edition, MIT Press, 1996: [book site at MIT Press] [HTML book] [SICP ebook site] [local copy of source code]
  5. Code from functional programming textbooks
    1. Abelson and Sussman's classic SICP textbook Structure and Interpretation of Computer Programs, Second Edition: [files]
    2. Simon Thompson's Haskell: The Craft of Functional Programming, Third Edition, Addison Wesley, 2011: [files]
    3. Paul Hudak's The Haskell School of Expression: Learning Functional Programming through Multimedia, Cambridge University Press, 2000: [files]

  6. Domain-Specific Language (DSL) design and implementation
    1. Jon Bentley. "Programming Pearls: Little Languages," Communications of the ACM, Vol. 29, No. 8, pp. 711-721, August 1986. [PDF]
    2. Martin Fowler's blog articles on Domain-Specific Languages
    3. Martin Fowler (with Rebecca Parsons). Domain Specific Languages, Addison Wesley, 2010: [DSL patterns catalog]
    4. Steve Freeman and Nat Pryce. "Evolving an Embedded Domain-Specific Language in Java," In Companion to the 21st ACM SIGPLAN Symposium on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '06), ACM, New York, NY, USA, 855-865, 2006: [PDF]
    5. H. C. Cunningham. "A Little Language for Surveys: Constructing an Internal DSL in Ruby," In Proceedings of the ACM SouthEast Conference, 6 pages, March 2008: [manuscript] [presentation]
  7. Free online language design textbooks, tutorials, and code
    1. Shiram Krishnamurthi. Programming Languages: Application and Interpretation, Second Edition:
      [HTML] [PDF] [Fall 2012 course] [Fall 2013 course]
    2. Source code for interpreters in the the textbook: Samuel N. Kamin. Programming Languages: An Interpreter-Based Approach, Addison Wesley, 1990.
  8. Parsing Expression Grammars and LPEG library
    1. Roberto Ierusalimschy's LPeg: Parsing Expression Grammars For Lua, version 0.12: [manual]
    2. Roberto Ierusalimschy's paper "A Text Pattern-Matching Tool Based on Parsing Expression Grammars," Software: Practice & Experience 39 #3 (2009) 221-258: [PDF]
    3. Roberto Ierusalimschy's talk LPEG: A New Approach to Pattern Matching [PDF slides] [video]
    4. Wikipedia entry on Parsing Expression Grammar.
    5. Bryan Ford's paper "Parsing Expression Grammars: A Recognition-Based Syntactic Foundation": [PDF slides]
    6. LPEG Tutorial [HTML]
    7. LPEG Recipies [HTML]
    8. Gavin Wraith's Around Pegs [HTML]
    9. Gavin Wraith's Parsing Expression Grammars [HTML]
    10. Dirk Laurie's Brief Introduction to LPEG [HTML]
  9. Miscellaneous Lua software found and used by students in projects
    1. Busted unit testing framework [docs]
    2. LOVE 2D game framework
  10. Examples and Lecture Notes

  11. (31 Aug - 03 Sept) Lua Tutorial
  12. Natural number pacakge:
    1. (05 Sept) Natural number package in Lua (nats.lua) inspired by Peano's Postulates.
    2. Revised version of package (nats2.lua) (Better abstraction to hide data representation).
    3. (For reference) Similar programs in other languages: [Java] [Ruby] [Scala (three versions, item 5)]

  13. Arithmetic Expression Tree program skeletons
      Functional versions
    1. (05 Sept) Recursive Functions with Record Representation (exprRecFuncRecord.lua)
    2. (12 Sept) Recursive Functions with List Representation (exprRecFuncList.lua)
    3. (12 Sept) Evaluation Function Table with List Representation (exprEvalTable.lua)]
    4. (For reference) Similar Scala code using case classes

    5. Object-oriented versions
    6. (26 Sept, 1 Oct) Prototype Object-Based (exprObjBased.lua)
    7. (1 Oct) Object-Oriented with Inheritance (exprObjInherit.lua)
  14. (10 Sept) Notes on Recursion Concepts and Terminology
  15. Example functions from SICP
    1. (12 Sept) Square root (Newton's Method)
    2. (10 Sept) Factorial
    3. (10 Sept) Fibonacci
    4. (10 Sept) Exponentiation
    5. (12 Sept) Greatest common divisor
    6. (12 Sept) Summation (takes function arguments)
    7. (12 Sept) Derivative (returns function)
  16. List Module
    1. (17-19 Sept) Cell-based list module: [module source] [test driver]
    2. (19 Sept) Closure-and-table-based list module variant: [module source] [test driver]
    3. (26 Sept, 1 Oct) Lazy list module variant using C reprocessor (cpp -P)
      [module source] [source after cpp] [test driver] [driver after cpp] [sh script]
    4. (5 Nov) Lazy list module variant using LuaMacro 2.5
      [macro definitions] [module macro source] [source after luam -o] [macro test driver] [driver after luam -o] [sh script]
    5. (developed after semester) Function-based cell list module variant: [module source] [test driver]
  17. Notes on Data Abstraction
    Note: Although we did not cover the Data Abstraction notes explicitly, they are useful in understanding the instructor's approach to developing modules.
  18. Complex number arithmetic modules adapted from SICP Section 2.4. (Modules are repeated in each package in which they are used.)
    1. (26 Sept) Rectangular coordinates modules
      [arithmetic:] [rectangular representation] [utilities] [test driver]
    2. (26 Sept) Polar coordinates modules:
      [arithmetic] [polar representation] [utilities] [test driver]
    3. (26 Sept) Tagged data modules:
      [arithmetic] [data tagging] [utilities] [test driver]
    4. (26 Sept) Data-directed programming modules:
      [arithmetic] [rectangular representation] [polar representation] [data tagging] [utilities] [test driver]
    5. (1 Oct) Object-oriented modules:
      [arithmetic] [utilities] [test driver]
  19. (26 Sept, 1-3 Oct) Notes on Object-Oriented Programming We discussed these notes through the section titled "An Object Model".
    Note: Along with the discussion of these notes, we examined the object-oriented versions of the Arithmetic Expression Tree and Complex Number examples above and the Movabale and Named Object example below.
  20. Movable and Named Objects example (based on a similar Haskell case study given in Section 14.6 of: Simon Thompson. Haskell: The Craft of Functional Programming, Third Edition, Addison Wesley, 2011.
    1. (3 Oct) First Lua version: [source (movable.lua)]
    2. Modularized version with improved class support
      [class_support module] [using class-support (movable2.lua)] [test driver (movable2Test.lua)]
    3. Other older versions: [Haskell source ] [Scala source (partial) ]
  21. (8 Oct) Parsing arithmetic expression trees using LPEG (Lua Parsing Express Grammar) library:
    1. Parser with captures
    2. Parser with semantic actions
  22. Lua versions similar to Martin Fowler's Lair Configuration domain-specific language (DSL) examples from his book chapter "One Lair and Twenty Ruby DSLs," Chapter 3, The ThoughtWorks Anthology: Essays on Software Technology and Innovation, The Pragmatic Bookshelf, 2008: [book site]

    Note: The DSL patterns mentioned are from the DSL patterns catalog from Martin Fowler's book Domain Specific Languages (Addison Wesley, 2010:

      Shared modules
    1. (15 Oct) Class support module (same as in Movable Objects case study)
      [class support module (class_support.lua)]
    2. (15 Oct) Semantic Model
      [model module (model.lua)] [test driver (rules00.lua)]

    3. Internal DSLs
    4. (15 Oct) Global Function Sequence
      [builder module (builder08.lua)] [dsl script (rules08.lua)] [test driver (test08.lua)]
    5. (15 Oct) Class Method Function Sequence with Method Chaining
      [builder module (builder11.lua)] [dsl script (rules11.lua)] [test driver (test11.lua)]
    6. (17 Oct) Expression Builder with Method Chaining
      [builder module (builder14.lua)] [dsl script (rules14.lua)] [test driver (test14.lua)]
    7. (17 Oct) Nested Closures
      [builder module (builder03.lua)] [dsl script (rules03.lua)] [test driver (test03.lua)]
    8. (17 Oct) Expression Builder with Object Scoping and Method Chaining
      [builder module (builder17.lua)] [dsl script (rules17.lua)] [test driver (test17.lua)]
    9. (22 Oct) Literal Collection
      [builder module (builder22.lua)] [dsl script (rules22.lua)] [test driver (test22.lua)]

    10. External DSL
    11. (22 Oct) LPEG Parser/Builder (no corresponding example in Fowler paper)
      [builder module (builderLPEG1.lua)] [dsl script (rulesLPEG1.dsl)] [test driver (testLPEG1.lua)]
  23. Lua Parsing Expression Grammar (LPEG) library
    1. (24 Oct) Roberto Ierusalimschy's talk LPEG: A New Approach to Pattern Matching [PDF slides] [video]
    2. (For reference) Roberto Ierusalimschy's paper "A Text Pattern-Matching Tool Based on Parsing Expression Grammars," Software: Practice & Experience 39 #3 (2009) 221-258: [PDF]
  24. (5-19 Nov) Kamin Interpreters in Lua Toolset (KILT) [Compressed tar file]

    1. Language/Interpreter-independent modules:
      [
      REPL Module (repl.lua)]
      [
      Environment Module (environment.lua)]
      [Function Table Module (funtab.lua)]
      [Utilities Module (utilities.lua)]
      [Opcodes Factory Module (opcodes.lua)]
      [Values Factory Module (values.lua) ]
      [Parser Factory Module (parser.lua)]
      [Evaluator Factory Module (evaluator.lua)]
    2. Kamin Chapter 1 Core language interpreter:
      [Core Interpreter (Core.lua)]
      [Core Opcodes (opcodes_core.lua)]
      [Core Values Module (values_core.lua)]
      [Core Parser Module (parser_core.lua)]
      [Core Evaluator Module (evaluator_core.lua)
    3. Kamin Chapter 2 Lisp language interpreter:
      [Lisp Interpreter (Lisp.lua)]
      [Lisp Opcodes (opcodes_lisp.lua)]
      [Lisp Values Module (values_lisp.lua)]
      [Lisp Parser Module (parser_lisp.lua)]
      [Lisp Evaluator Module (evaluator_lisp.lua)
      [A few Lisp examples]
    4. Kamin Chapter 4 Scheme language interpreter:
      [Scheme Interpreter (Scheme.lua)]
      [Scheme Opcodes (opcodes_scheme.lua)]
      [Scheme Values Module (values_scheme.lua)]
      [Scheme Parser Module (parser_scheme.lua)]
      [Scheme Evaluator Module (evaluator_scheme.lua)
      [A few Scheme examples]

  25. (19-22 Nov exam, 3 Dec lecture) Sandwich DSL
    1. Semantic model module (sandwich_model.lua)
    2. DSL builder module using function sequence pattern (sandwich_builder.lua)
    3. Test driver (test_sandwichDSL.lua)
  26. (19-22 Nov exam, 3 Dec lecture) Carrie's Candy Bowl ADT
    1. Description of bag concept
    2. Hashed version (candybowl_hash.lua). This file has a description of the problem and the formal invariant, precondition, and postcondition assertions.
    3. Unsorted list version (candybowl_list.lua)
    4. Test driver (test_candybowl.lua)
  27. (Not discussed directly) Notes on Functional Program Evaluation Concepts


UP to CSci 658 root document?


Copyright © 2013, H. Conrad Cunningham
Last modified: Mon Sep 1 19:29:01 CDT 2014