CSci 450-01: Organization of Programming Languages
CSci 503-01: Fundamental Concepts in Languages
Fall 2014

Lecture Notes and Web Resources


Sections

  • Reference Materials
  • Schedule, Lecture Notes, and Examples

    1. Reference Materials

    2. Free online programming language textbooks and tutorials
    3. Functional programming using Haskell:
        Primary Haskell lecture notes and tutorials for course
      1. H. Conrad Cunningham. Notes on Functional Programming with Haskell
        This document is under revision during Fall 2014 and may change frequently. Reload the page or clear the browser cache to ensure that you see the latest version.
      2. Miron Lipovaca. Learn You a Haskell for Great Good: A Beginner's Guide, online tutorial
        This book is also available in print, published by No Starch Press April 2011.

      3. Other Haskell books
      4. Kees Doets and Jan van Eijck. The Haskell Road to Logic, Math and Programming, March 2004
        This book is also available in print, published by College Publications, 2004.
      5. Paul Hudak. The Haskell School of Music: From Signals to Symphonies, Version 2.6, January 2014
        This book is a recent rewrite of Hudak's The Haskell School of Expression: Learning Functional Programming through Multimedia, Cambridge University Press, 2000: [source code for SOE]
      6. Simon Marlowe. Parallel and Concurrent Programming in Haskell: Techniques for Multicore and Multithreaded Programming, 2013
        This book is also available in print, published by O'Reilly Media 2013.
      7. Bryan O'Sullivan, Don Stewart, and John Goerzen. Real World Haskell: [HTML book]
        This book is also available in print, published by O'Reilly Media November 2008.
      8. (book not online) Simon Thompson. Haskell: The Craft of Functional Programming, Third Edition, Addison Wesley, 2011:
        [source code] [local copy of source code]

      9. Other Haskell resources
      10. Haskel project web site
    4. Lua:
      1. (Textbook not available online) Roberto Ierusalimshcy. Programming in Lua( PiL), Third Edition, Lua.org, Rio de Janiero, 2013 (covers Lua 5.2)
      2. Course notes by Fabio Mascarenhas for a course based on Programming in Lua
      3. Official Lua language site: [download ] [documentation]
      4. Lua users site: [wiki]
      5. Lua Tutorial
      6. Love 2D game framework
    5. Prolog:
      1. Patrick Blackburn, Johan Bos, and Kristina Striegnitz. Learn Prolog Now, online tutorial
      2. SWI Prolog, stable release 6.6.6, available from http://www.swi-prolog.org/ or various other repositories.
    6. William R. Cook. Anatomy of Programming Languages, online draft
    7. Kathleen Fisher's lectures on programming languages: [local]
    8. (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]
    9. Shiram Krishnamurthi. Programming Languages: Application and Interpretation, Second Edition:
      [HTML] [PDF] [Fall 2012 course] [Fall 2013 course]

    10. Schedule, Lecture Notes, and Examples

    11. (25 Sep) Examine syllabus and discuss class organization. Separate CSci 503 and pre-MS students into new meeting time (10:00 MWF, Weir 106).
    12. Discuss the changes in computer systems over past 70 years and their implications for programming and programming language design.
      1. (27 Sep) Effect of Computing Hardware Evolution on Programming Languages, instructor's lecture notes
      2. (for reference) Nathan Ensmegner's Early History of Computing, The Franklin Institute
      3. (for reference) Wikipedia article on the History of Computing Hardware
      4. (for reference) Wikipedia article on the Timeline of Computing
    13. (27 Aug) Discuss Backus' Turing Award lecture excerpt in Notes on Functional Programming with Haskell, section 1.2, pages 2-4.

      General programming language concepts: von Neumann computer architecture, von Neumann bottleneck, von Neumann language, "orderly" world of expressions, "disorderly" world of (assignment) statements
    14. (29 Aug) Discuss history of programming languages over past 60-plus years, calling attention to the emergence of paradigms and major languages. See instructor's notes.
    15. Discuss programming paradigms
      1. General programming language concepts: programming language paradigm, imperative language, declarative language, functional language, relational or logic language; program state, implicit versus explicit state; execution of commands versus evaluation of expressions
      2. (29 Aug) Lecture from Notes on Functional Programming with Haskell, section 1.3, pages 5-6
    16. Discuss simple factorial function example to explore Haskell syntax and semantics.
      1. Background reading: Chapter 2 "Starting Out" of Learn You a Haskell for Great Good
      2. (for reference) GHCi User's Guide
      3. (3 Sep) Lecture from Chapter 3 of Notes on Functional Programming with Haskell, pages 17-22
      4. (3 Sep) Demonstrate the GHCi (Glasgow Haskell Compiler interactive interface) using the factorial functions from Chapter 3.
        Note: GHCi is an interactive REPL (Read-Evaluate-Print-Loop) tool for the Haskell language.
    17. Discuss reasons for studying functional programming.
      1. General programming language concepts: referential transparency, abstraction, first-class functions, higher-order functions, eager versus lazy evaluation
      2. (5 Sep) Lecture from Section 1.4 of Notes on Functional Programming with Haskell, pages 6-8
    18. Discuss basic Haskell functional programming concepts from Chapter 5 of Notes on Functional Programming with Haskell, pages 25-54.

      1. General programming language concepts: data types, lists, pattern matching, recursion, termination of recursive programs, recursive programming styles (backward, forward, and tail recursion), accumulating parameter technique, programming with immutable data structures, designing data representations
      2. Background reading: Chapters 2, 3, 4, and 5 of Learn You a Haskell for Great Good
      3. (for reference) Haskell Cheat Sheet
      4. Haskell modules from Notes Chapter 5
      5. Note: Although we put the code in Haskell modules, we did not discuss the principles of module design or data abstraction in the Haskell context (except some discussion of data representation). We later did this in the Lua context. The same general principles apply to Haskell.

      6. (5-8 Sep) Haskell builtin data types, section 5.1, pages 25-29
      7. (8 Sep) Programming with list patterns, section 5.2, pages 30-34
      8. (10-12 Sep) Infix operators, recursive programming styles, more list operations, and the rational arithmetic package, section 5.3-6, pages 35-47
      9. (15 Sep) Standard Prelude functions
      10. (15 Sep) IO program to test an xor function
      11. (17 Sep) Live coding demonstration using exercises 6 and 8 at the end of Chapter 5
      12. (19 Sep) Example rjustify function
      13. (19 Sep) Haskell exponentiation function examples--backward, tail, and logarithmic (Also see Lua version below3 &)

      14. (for reference) Related Lua discussion

    19. Discuss Haskell higher-order functions from Chapter 6 of Notes on Functional Programming with Haskell, pages 55-78.

      1. General programming language concepts: first-class functions, higher-order functions, maps, filters, folds, strictness of operations, Currying, partial application, combinators, functional composition, anonymous functions (lambda expressions)
      2. Background reading: Chapter 6 of Learn You a Haskell for Great Good
      3. Haskell modules from Notes Chapter 6

      4. (12-15 Sep) Capturing computational patterns using higher-order functions: Maps and filters from sections 6.1-2, pages 55-58
      5. (19-22 Sep) Capturing more computational patterns using higher-order functions: folds from section 6.3, pages 58-61
      6. (22 Sep) Example uses of fold functions
      7. (22 Sep) Higher-order function concepts and features: Strictness and currying from sections 6.4-5, pages 61-63
      8. (24-26 Sep) Higher-order function concepts and features: Operator sections, combinators, and functional composition, and lambda expressions from sections 6.6-9, pages 64-69
      9. (26 Sep) Capturing more computational patterns: List-breaking and list-combining functions, sections 6.10-11, pages 69-71
      10. (26 Sep) Case studies: Rational arithmetic package revisited and cosequential processing package, sections 6.12-13, pages 72-74

      11. (for reference) Related Lua discussion
    20. Discuss Haskell sequences and comprehensions from Chapter 7 of Notes on Functional Programming with Haskell, pages 79-84.

      1. General programming language concepts: sequences, list comprehensions, solve a more general problem first
      2. Background reading: Sections "Texas ranges" and "I'm a list comprehension" in Chapter 2 of Learn You a Haskell for Great Good
      3. Haskell modules from Notes Chapter 7

      4. (15 Sep) Discuss Haskell sequences and comprehensions from Chapter 7 of Notes on Functional Programming with Haskell, pages 79-82.
      5. (19 Sep) Discuss "first occurrence in a list" problem and "solve a harder problem" strategy from section 7.2.6 of Notes on Functional Programming with Haskell, page 83.

      6. (for reference) Related Lua discussion
        • Lua list module case study below includes function traverse; this function sets up a stateless iterator function to enable use of the list abstract data type with Lua's generic for construct
    21. Examination 1
      1. (29 Sep) Covers everything to this point in the semester (e.g. items 9-18 of this list)
      2. (for reference) 2010 Functional Programming exam: [CSci 555 Exam 1] [partial solution]
      3. (6 Oct) Discuss graded exam: [solution]
    22. (1 Oct, for Assignment #3) Discuss recognizing regular expressions case study from Simon Thompson. Haskell: The Craft of Functional Programming, Third edition, Addison Wesley, 2011. Assignment #3 requires us to treat functions as data.

    23. Discuss Haskell algebraic data types and type classes,

      1. General programming language concepts: types; algebraic data types (enumerated types, tuple types, disjoint union types, recursive types); Haskell type system concepts (type classes, instances, overloading, inheritance) versus related Java/C++ type system concepts (abstract and concrete classes, objects, inheritance, interfaces); pattern matching
      2. Background reading: Chapter 3 and Chapter 8 of Learn You a Haskell for Great Good
      3. Haskell modules from Notes Chapter 8
      4. (for reference) Kathleen Fisher's slides on Type Classes
      5. (for reference) Kathleen Fisher's slides on Types

      6. (3, 8 Oct) Chapter 8 of Notes on Functional Programming with Haskell, pages 85-94
      7. (8-10 Oct) Overloading and Type Classes
      8. (planned, but not discussed directly Type Inference

      9. (for reference) Related Lua discussion
    24. Discuss problem-solving techniques.
      1. General concepts: George Polya's four phases of problem solving; problems-solving strategies (solve a more general problem first, solve a simpler problem first, reuse off-the-shelf solutions to standard subproblems, solve a related problem, separate concerns, divide and conquer)
      2. (10 Oct) Chapter 10 of Notes on Functional Programming with Haskell, pages 105-108
    25. (13 Oct) 9:00 CSci 450 class meets with ABET/CAC Program Evaluator. 10:00 CSci 503 class did not meet.
    26. Discuss languages from Chapter 1 of William Cook's Anatomy of Programming Languages (AoPL).
      1. AoPL Chapter 1 concepts: language, syntax, semantics; metaprogram; expressions, statements, side effects
      2. (used below with AoPL sections) Bruno Oliviera's slides for AoPL
      3. (15 Oct) Introduction to languages (pages 8-9) (Oliveira's lecture 4 slides)
    27. Discuss expressions, syntax, and evaluation from Chapter 2 of William Cook's Anatomy of Programming Languages (AoPL).

      1. AoPL Chapter 2 concepts: expression, syntax, evaluation; concrete and abstract syntax; literal, token, identifier, grammar, syntactic category, production rule, terminal, nonterminal, precedence, associativity, parser generator, object language, metalanguage
      2. (for reference) Source code for simple language: [Lexer.hs] [Simple.hs] [Base.hs] [SimpleParse.y] [SimpleTest.hs]
      3. (used below with AoPL sections) Bruno Oliviera's slides for AoPL

      4. (15 Oct) Simple language of arithmetic--abstract syntax, and recognizing tokens in concrete syntax (pages 19-21) (Oliveira's lecture 6 slides)
      5. (20 Oct) Simple language for arithmetic--concrete syntax, grammars, and evaluation (pages 23-30) (Oliveira's lecture 6 slides)

      6. (for reference) Related Lua discussion
    28. Discuss Section 4.1 "Compilers and Syntax" (pages 48-57) of John Mitchell's Concepts in Programming Languages, Cambridge University Press, 2003. This handout discusses general programming language concepts but not explicitly in the context of Haskell or other languages.
      1. (17 Oct) Phases of a simple compiler (described in handout): lexical analysis, syntax analysis, semantic analysis, intermediate code generation, code optimization, and code generation
      2. (17 Oct) Other optional phases discussed (but not described in this handout): lexical preprocessing (e.g., as in C) before lexical analysis and assembly, linking, loading (static and dynamic), and just-in-time compilation after code generation
      3. Note: In the future, this course should mention macro expansion and other metaprogramming operations occurring during syntax analysis or later (i.e., operate on abstract syntax trees, other representations, or at runtime.
      4. (for reference) Grammar and parse tree concepts: grammars, derivations, parse trees, ambiguity, parsing, and precedence (This part of the handout was not discussed, but it was discussed with Anatomy of Programming Languages Chapters 2 and 3.)
    29. (22 Oct) No class because of instructor illness.

    30. Discuss variables in the arithmetic expression language from Chapter 3 of William Cook's Anatomy of Programming Languages.
      1. AoPL Chapter 3 concepts: variable, binding, mutation, substitution, renaming, environment, local variable, scope, unbound variable, bound variable, free variable, static and dynamic properties
      2. (used below with AoPL sections) Bruno Oliviera's slides for AoPL
      3. (24, 29 Oct) Adding global and local variables to the arithmetic expression tree (Oliveira's lecture 7, 8, 9 slides).
    31. Discuss domain-specific languages in Haskell.

      1. General programming language concepts: domain-specific languages (DSLs); DSLs versus general-purpose programming languages; external versus internal DSLs; shallow versus deep embedding of internal DSLs; use of algebraic data types to implement DSLs

      2. (27 Oct) Domain-Specific Languages, instructor's lecture notes
      3. (27-29 Oct) SandwichDSL Case Study, instructor's lecture notes (with significant revisions on 28 October)
      4. (29 Oct) Assignment #4, based on the SandwichDSL case study, requires us to use Haskell algebraic data types to implement a small, deeply embedded, internal DSL.

      5. (for reference) Related Lua discussion
        • Lua case studies on arithmetic expression trees, natural numbers, and immutable lists essentially implements Lua algebraic data types
        • Fowler's Lair Configuration DSL case study implements several internal (and one external) DSL using various techniques in Lua
        • Sandwich DSL in Lua case study is similar to (but not precisely the same as) the sandwich building phases of this Haskell case study; for example, the Lua version uses a mutable data structure (although it just extends Lua arrays to include new elements) and allows multiple copies of a sandwich in one specification
    32. (29 Oct) Review solutions to Assignments #2 and #3.
    33. Examination 2
      1. (3 Nov) Emphasizes topics covered since Exam 1 (e.g., items 20-30 of this list) plus concepts needed for homework assignments 2-4. Of course, the Haskell language and programming concepts needed may include anything from the beginning of the semester
      2. (31 Oct) 2010 Functional Programming exam: [CSci 555 Exam 2] [partial solution]
        Note: This is only a partial model for the exam. The 555 exam does not cover the language processing content. Only problems 1, 2, 5, and 7 are relevant to this course.
      3. (7 Nov) Discuss graded exam: [partial solution]
    34. Discuss basic Lua concepts using Fabio Mascarenhas's Lecture Notes, based on the Programming in Lua textbook.

      1. General programming language concepts: types (static versus dynamic, strong versus weak, duck typing); primitive data types; scope of variables (global versus local, lexical scoping, nested scopes, shadowing); control constructs; functions versus procedures, side effects; first-class and higher-order functions; closures, callbacks; tail recursion optimization; Currying
      2. Background reading: Chapters 1-8 of Programming in Lua (PiL), pages 1-82

      3. (5-10 Nov) Mascarenhasa Notes: Introduction to Lua, Getting Started, Types and Values
      4. (10-12 Nov) Mascarenhas Notes: Control Flow, Functions
      5. (14 Nov) Mascarenhas Notes: Data Structures
      6. (should study for exam 3 & 4) Mascarenhas Notes: More Functions
      7. (planned, but not discussed directly) Mascarenhas Notes: Iterators, Handling Errors
    35. Discuss Lua modules, metatables, and objects using Fabio Mascarenhas's Lecture Notes and other materials

      1. General programming language concepts: modular programming, information hiding, and abstract data types; object-based programming, especially prototype-based; single and multiple inheritance (i.e., object-oriented programming)
      2. Background reading: Chapters 13, 15, and 16 of Programming in Lua (PiL)

      3. (should study for exam 3 & 4) Mascarenhas Notes: Modules
      4. (19 Nov) Mascarenhas Notes: Metatables, Objects
    36. (for Assignment #5) Arithmetic expression tree program skeletons (Lua)

        Functional versions
      1. Background reading: Chapter 11 (pages 107-116) of Programming in Lua (PiL) for table-based implementations of various data structures in Lua
      2. (12 Nov) Recursive Functions with Record Representation (exprRecFuncRecord.lua)
      3. (14 Nov) Recursive Functions with List Representation (exprRecFuncList2.lua)
      4. (14 Nov) Evaluation Function Table with List Representation (exprEvalTable2.lua)]
      5. (for reference) Similar Scala code using case classes

      6. Object-oriented versions
      7. Background reading: Chapter 16 (pages 163-173) of Programming in Lua (PiL) for object-oriented programming in Lua and the instructor's Introduction to Object Orientation lecture notes
      8. (19 Nov) Prototype Object-Based (exprObjBased.lua)
      9. (for reference) Object-Oriented with Inheritance (exprObjInherit.lua)

      10. Parsers (not covered Fall 2014)
      11. LPEG parser with captures
      12. LPEG parser with semantic actions
    37. (for reference) Data Abstraction, instructor's lecture notes
    38. Lua list module case study

      1. Purpose: This Lua case study illustrates (i) functional programming principles, (ii) design and implementation methods for abstract data types and information hiding modules, and (iii) Lua programming techniques (linked lists, stateless iterators, closures, metatables, etc.)
      2. General programming language concepts: information-hiding module, interface, secret, changeability, data representation, interface and implementation invariants for modules (or abstract data types), preconditions and postconditions for functions, primitive operation (function), convenience operation (function), function closure, proxy
      3. Background reading on Lua: Chapter 11 on data structures (pages 107-116) and Chapter 15 on modules (pages 151-161) of Programming in Lua (PiL)
      4. Background reading on modular programming: Data Abstraction lecture notes

      5. (17 Nov) Lua Module Design Principles, instructor's lecture notes
      6. (17 Nov) Cell-based list module: [module source] [test driver]
      7. (for reference) Closure-and-table-based list module variant: [module source] [test driver]
      8. (for reference) Function-based cell list module variant: [module source] [test driver]

      9. (not covered Fall 2014) Lazy list module variant using C preprocessor (cpp -P)
        [module source] [source after cpp] [test driver] [driver after cpp] [sh script]
      10. (not covered Fall 2014) 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]
    39. (copies distributed, but not discussed directly) Carrie's Candy Bowl ADT in Lua

      1. Purpose: Carrie's Candy Bowl case study illustrates design and implementation methods for abstract data types (ADTs) and information hiding modules in Lua. It gives formal interface implementation invariants for the ADT module and precondition and postcondition assertions for each function (operation).
      2. General programming language concepts: information-hiding module, interface, data representation, interface and implementation invariants for abstract data types (ADTs), preconditions and postconditions for ADT operations, mathematical bag
      3. Background reading on modular programming: Data Abstraction lecture notes

      4. ADT Problem Description
      5. ADT Semantics
      6. Description of Bag Concept
      7. Data Representations
      8. Hashed version (candybowl_hash.lua)
      9. Unsorted list version (candybowl_list.lua)
      10. Test driver (test_candybowl.lua)
    40. (for reference) Introduction to Object-Orientation, instructor's lecture notes--through the section titled "An Object Model".

      Note: In CSci 658, along with the discussion of these notes, we examined the object-oriented versions of the Arithmetic Expression Tree, Complex Number, and the Movable and Named Object example.
    41. (for reference) Movable and Named Objects case study (in Lua but based on a Haskell case study by Thompson)

      1. Purpose: The Named and Movable Objects case study explores use of inheritance hierarchies and multiple inheritance in Lua. I also extracted a "class support module" from the initial version of this code; this module was used in later case studies (e.g., Lair Configuration DSL).
      2. General object-oriented programming language concepts: prototype object, class, subclass (child) class, superclass (parent or base class), abstract and concrete classes, single and multiple inheritance, abstract (deferred) methods, constructor (factory method), accessor and mutator methods, proxy object, method injection, template method pattern (template and hook methods)
      3. Background reading on object-oriented programming languages: Introduction to Object-Orientation, instructor's lecture notes through the section titled "An Object Model"
      4. Background reading on case study: Section 14.6 of Simon Thompson. Haskell: The Craft of Functional Programming, Third Edition, Addison Wesley, 2011
      5. Note: We should readdress the design and implementation of this case study and the class support module. The latter may be too complex for our purposes in this course.

      6. First Lua version: [source (movable.lua)]
      7. Modularized version with improved class support
        [class_support module] [using class-support (movable2.lua)] [test driver (movable2Test.lua)]

      8. Other older versions: [Haskell source ] [Scala source (partial) ]
    42. Examination 3
      1. (21 Nov) Emphasizes Lua-related topics covered since Exam 2
      2. (5 Dec) Discuss graded exam
    43. Discuss scope, functions, and storage management.

      1. General programming language concepts: block structure, scope, global and local variables, block-based (stack) memory management, lifetime, program counter, environment pointer, activation record, control link, return address, function calls, parameters, static versus dynamic scope, parameter passing (by value and by reference), access link, intermediate results, tail recursion, tail call optimization (tail recursion elimination), higher order functions, recurion, closure
      2. Background reading: Chapter 7 (pages 204-231) of John Mitchell's Concepts in Programming Languages, Cambridge University Press, 2003

      3. (1 Dec) Slides
      4. Note: In Fall 2014, we only covered the material through parameter passing. In the future, we need to cover the higher-order function material.
    44. (3 Dec) Discuss solution to Assignment #4 (Sandwich DSL in Haskell)
    45. (8 Dec) Provide solution to Assignment #5 (Arithmetic Expression Trees in Lua)
    46. End-of-semester examinations
      1. For CSci 450, the Final Exam Period is Wednesday, 10 December, 8:00 a.m.
        For CSci 503, the Final Exam Period is same as CSci 450
      2. (Final Exam Period) 30 question multiple choice assessment exam over entire semester
      3. (Final Exam Period) Three-hour comprehensive final examination over entire semester
    47. Reference Materials from Fall 2013 CSci 658 (Software Language Engineering) class

    48. (for reference) Recursion Concepts and Terminology (Using Lua Examples), instructor's lecture notes. (We covered this recursive styles content from Chapter 5 of the Notes on Functional Programming with Haskell.)
    49. (for reference) Example recursive Lua functions adapted from the Scheme versions in SICP Chapter 1
      1. Background reading: Chapter 1 of Abelson and Sussman's Structure and Interpretation of Computer Programs, Second Edition, MIT Press, 1996
      2. Square root (Newton's Method)
      3. Factorial
      4. Fibonacci
      5. Exponentiation
      6. Greatest common divisor
      7. Summation (takes function arguments)
      8. Derivative (returns function)
    50. (for reference) Natural number arithmetic case study
      1. Natural number package in Lua (nats2.lua)
      2. Older Lua version with less distinct data abstraction layers
      3. Similar programs in other languages: [Java] [Ruby] [Scala (three versions, item 5)]

    51. (for reference) Complex number arithmetic modules in Lua adapted from SICP Section 2.4.

      1. Background reading: Section 2.4 of Abelson and Sussman's Structure and Interpretation of Computer Programs, Second Edition, MIT Press, 1996

      2. Modules are repeated in each package in which they are used
      3. Rectangular coordinates modules
        [arithmetic] [rectangular representation] [utilities] [test driver]
      4. Polar coordinates modules:
        [arithmetic] [polar representation] [utilities] [test driver]
      5. Tagged data modules:
        [arithmetic] [data tagging] [utilities] [test driver]
      6. Data-directed programming modules:
        [arithmetic] [rectangular representation] [polar representation] [data tagging] [utilities] [test driver]

      7. Object-oriented modules:
        [arithmetic] [utilities] [test driver]
    52. (for reference) Lua adaptation of Fowler's Lair Configuration DSL

      1. Background reading on case study: Martin Fowler, One Lair and Twenty Ruby DSLs, Chapter 3, The ThoughtWorks Anthology: Essays on Software Technology and Innovation, The Pragmatic Bookshelf, 2008: [book site]
      2. Background reading on DSL patterns: DSL patterns catalog from Martin Fowler's book Domain Specific Languages, Addison Wesley, 2010
      3. Caveat: Some of these DSL programs may depend upon features from Lua 5.1 that were changed in Lua 5.2.

      4. Shared modules
      5. Class support module (same as in Movable Objects case study)
        [class support module (class_support.lua)]
      6. Semantic Model
        [model module (model.lua)] [test driver (rules00.lua)]

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

      14. External DSL
      15. LPEG Parser/Builder (no corresponding example in Fowler paper)
        [builder module (builderLPEG1.lua)] [dsl script (rulesLPEG1.dsl)] [test driver (testLPEG1.lua)]
    53. (for reference) Sandwich DSL in Lua (related but not precisely the same as the Haskell SandwichDSL above)
      1. Semantic model module (sandwich_model.lua)
      2. DSL builder module using function sequence pattern (sandwich_builder.lua)
      3. Test driver (test_sandwichDSL.lua)
    54. (for reference) Lua Parsing Expression Grammar (LPEG) library
      1. 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]
    55. (for reference) 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]

    56. (Not discussed directly in CSci 658) Functional Program Evaluation Concepts, instructor's lecture notes

    UP to CSci 450/503 root document?


    Copyright © 2014, H. Conrad Cunningham
    Last modified: Mon Apr 17 10:16:26 CDT 2017