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
Reference Materials
- Free online
programming language textbooks and tutorials
- Functional programming using Haskell:
Primary Haskell lecture notes and tutorials for course
- 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.
- 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.
Other Haskell books
- 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.
- 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]
- 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.
- 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.
- (book not online) Simon Thompson. Haskell: The Craft of
Functional Programming, Third Edition, Addison Wesley,
2011:
[source code] [local copy
of source code]
Other Haskell resources
- Haskel project web site
- Lua:
- (Textbook not available online) Roberto Ierusalimshcy.
Programming in Lua( PiL), Third Edition, Lua.org, Rio
de Janiero, 2013 (covers Lua 5.2)
- Course notes
by Fabio Mascarenhas for a course based on Programming in Lua
- Official Lua language site:
[download ] [documentation]
- Lua users site:
[wiki]
- Lua
Tutorial
- Love 2D game framework
- Prolog:
- Patrick Blackburn, Johan Bos, and Kristina Striegnitz. Learn Prolog
Now, online tutorial
- SWI Prolog, stable release 6.6.6, available from http://www.swi-prolog.org/
or various other repositories.
- William R. Cook. Anatomy of
Programming Languages, online draft
- Kathleen Fisher's lectures on programming languages:
[local]
- (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]
- Shiram Krishnamurthi. Programming Languages: Application
and Interpretation, Second Edition:
[HTML]
[PDF]
[Fall 2012 course]
[Fall 2013 course]
Schedule, Lecture Notes, and Examples
- (25 Sep) Examine syllabus and discuss class
organization. Separate CSci 503 and pre-MS students into new meeting
time (10:00 MWF, Weir 106).
- Discuss the changes in computer systems over past 70
years and their implications for programming and programming language
design.
- (27 Sep) Effect of
Computing Hardware Evolution on Programming Languages,
instructor's lecture notes
- (for reference) Nathan Ensmegner's Early History of
Computing, The Franklin Institute
- (for reference) Wikipedia article on the History of Computing Hardware
- (for reference) Wikipedia article on the Timeline of Computing
- (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
- (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.
- Discuss programming paradigms
- 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
- (29 Aug) Lecture from Notes on Functional Programming with Haskell,
section 1.3, pages 5-6
- Discuss simple factorial function example to explore
Haskell syntax and semantics.
- Background reading: Chapter 2 "Starting
Out" of Learn You a Haskell for Great Good
- (for reference) GHCi
User's Guide
- (3 Sep) Lecture from Chapter 3 of Notes on Functional Programming with Haskell,
pages 17-22
- (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.
- Discuss reasons for studying functional programming.
- General programming language concepts: referential
transparency, abstraction, first-class functions, higher-order
functions, eager versus lazy evaluation
- (5 Sep) Lecture from Section 1.4 of Notes on Functional Programming with Haskell,
pages 6-8
- Discuss basic Haskell functional programming concepts from
Chapter 5 of Notes on Functional
Programming with Haskell, pages 25-54.
- 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
- Background reading: Chapters 2, 3, 4, and 5
of Learn You a
Haskell for Great Good
- (for reference) Haskell Cheat
Sheet
- Haskell modules from Notes
Chapter 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.
- (5-8 Sep) Haskell builtin data types, section 5.1, pages 25-29
- (8 Sep) Programming with list patterns, section 5.2, pages
30-34
- (10-12 Sep) Infix operators, recursive programming styles, more
list operations, and the rational arithmetic package, section 5.3-6,
pages 35-47
- (15 Sep) Standard Prelude functions
- (15 Sep) IO program to test an xor function
- (17 Sep) Live coding demonstration using exercises 6 and 8 at the end of
Chapter 5
- (19 Sep) Example rjustify function
- (19 Sep) Haskell exponentiation function examples--backward, tail, and
logarithmic (Also see Lua version below3 &)
- (for reference) Related Lua discussion
- Discuss Haskell higher-order functions from Chapter 6 of Notes on Functional Programming with
Haskell, pages 55-78.
- 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)
- Background reading: Chapter 6 of Learn You a Haskell
for Great Good
- Haskell modules from
Notes Chapter 6
- (12-15 Sep) Capturing computational patterns using higher-order
functions: Maps and filters from sections 6.1-2, pages 55-58
- (19-22 Sep) Capturing more computational patterns using
higher-order functions: folds from section 6.3, pages 58-61
- (22 Sep) Example uses of fold
functions
- (22 Sep) Higher-order function concepts and features:
Strictness and currying from sections 6.4-5, pages 61-63
- (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
- (26 Sep) Capturing more computational patterns: List-breaking
and list-combining functions, sections 6.10-11, pages 69-71
- (26 Sep) Case studies: Rational arithmetic package revisited
and cosequential processing package, sections 6.12-13, pages 72-74
- (for reference) Related Lua discussion
- Discuss Haskell sequences and comprehensions from Chapter 7
of Notes on Functional
Programming with Haskell, pages 79-84.
- General programming language concepts: sequences, list
comprehensions, solve a more general problem first
- Background reading: Sections "Texas ranges" and "I'm a list
comprehension" in Chapter 2 of Learn You a Haskell for Great
Good
- Haskell modules from Notes
Chapter 7
- (15 Sep) Discuss Haskell sequences and comprehensions from
Chapter 7 of Notes on
Functional Programming with Haskell, pages 79-82.
- (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.
- (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
- Examination 1
- (29 Sep) Covers everything to this point in the semester
(e.g. items 9-18 of this list)
- (for reference) 2010 Functional Programming exam:
[CSci 555 Exam 1]
[partial solution]
- (6 Oct) Discuss graded exam: [solution]
- (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.
- Discuss Haskell algebraic data types and type classes,
- 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
- Background reading: Chapter 3
and Chapter 8 of Learn You a Haskell for Great Good
- Haskell modules from Notes
Chapter 8
- (for reference) Kathleen Fisher's slides on Type Classes
- (for reference) Kathleen Fisher's slides on Types
- (3, 8 Oct) Chapter 8 of Notes on
Functional Programming with Haskell, pages 85-94
- (8-10 Oct) Overloading and Type
Classes
- (planned, but not discussed directly Type Inference
- (for reference) Related Lua discussion
- Discuss problem-solving techniques.
- 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)
- (10 Oct) Chapter 10 of Notes on Functional Programming with Haskell,
pages 105-108
- (13 Oct) 9:00 CSci 450 class meets with ABET/CAC Program Evaluator.
10:00 CSci 503 class did not meet.
- Discuss languages from Chapter 1 of William Cook's Anatomy of Programming
Languages (AoPL).
- AoPL Chapter 1 concepts: language, syntax, semantics;
metaprogram; expressions, statements, side effects
- (used below with AoPL sections) Bruno
Oliviera's slides for AoPL
- (15 Oct) Introduction to languages (pages 8-9)
(Oliveira's lecture 4 slides)
- Discuss expressions, syntax, and evaluation from Chapter 2 of William Cook's Anatomy of Programming
Languages (AoPL).
- 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
- (for reference) Source code for simple language:
[Lexer.hs]
[Simple.hs]
[Base.hs]
[SimpleParse.y]
[SimpleTest.hs]
- (used below with AoPL sections) Bruno
Oliviera's slides for AoPL
- (15 Oct) Simple language of arithmetic--abstract syntax, and
recognizing tokens in concrete syntax (pages 19-21) (Oliveira's
lecture 6 slides)
- (20 Oct) Simple language for arithmetic--concrete syntax,
grammars, and evaluation (pages 23-30) (Oliveira's lecture 6
slides)
- (for reference) Related Lua discussion
- 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.
- (17 Oct) Phases of a simple compiler (described in handout):
lexical analysis, syntax analysis, semantic analysis, intermediate
code generation, code optimization, and code generation
- (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
- 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.
- (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.)
- (22 Oct) No class because of instructor illness.
- Discuss variables in the arithmetic expression language from
Chapter 3 of William Cook's Anatomy of Programming
Languages.
- AoPL Chapter 3 concepts:
variable, binding, mutation, substitution, renaming, environment,
local variable, scope, unbound variable, bound variable, free
variable, static and dynamic properties
- (used below with AoPL sections) Bruno
Oliviera's slides for AoPL
- (24, 29 Oct) Adding global and local variables to the
arithmetic expression tree (Oliveira's lecture 7, 8, 9 slides).
- Discuss domain-specific languages in Haskell.
- 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
- (27 Oct) Domain-Specific
Languages, instructor's lecture notes
- (27-29 Oct) SandwichDSL Case Study,
instructor's lecture notes (with significant revisions on 28
October)
- (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.
- (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
- (29 Oct) Review solutions to Assignments #2 and #3.
- Examination 2
- (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
- (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.
- (7 Nov) Discuss graded exam:
[partial solution]
- Discuss basic Lua concepts using Fabio Mascarenhas's Lecture
Notes, based on the Programming in Lua textbook.
- 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
- Background reading: Chapters 1-8 of Programming in
Lua (PiL), pages 1-82
- (5-10 Nov) Mascarenhasa Notes: Introduction to Lua, Getting
Started, Types and Values
- (10-12 Nov) Mascarenhas Notes: Control Flow, Functions
- (14 Nov) Mascarenhas Notes: Data Structures
- (should study for exam 3 & 4) Mascarenhas Notes: More
Functions
- (planned, but not discussed directly) Mascarenhas Notes:
Iterators, Handling Errors
- Discuss Lua modules, metatables, and objects using
Fabio Mascarenhas's
Lecture Notes and other materials
- 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)
- Background reading: Chapters 13, 15, and 16 of
Programming in Lua (PiL)
- (should study for exam 3 & 4) Mascarenhas Notes: Modules
- (19 Nov) Mascarenhas Notes: Metatables, Objects
- (for Assignment
#5) Arithmetic expression tree program skeletons (Lua)
Functional versions
- Background reading: Chapter 11 (pages 107-116) of
Programming in Lua (PiL) for table-based
implementations of various data structures in Lua
- (12 Nov) Recursive Functions with Record Representation
(exprRecFuncRecord.lua)
- (14 Nov) Recursive
Functions with List Representation (exprRecFuncList2.lua)
- (14 Nov) Evaluation
Function Table with List Representation (exprEvalTable2.lua)]
- (for reference) Similar Scala code using case classes
Object-oriented versions
- 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
- (19 Nov) Prototype Object-Based
(exprObjBased.lua)
- (for reference)
Object-Oriented with Inheritance (exprObjInherit.lua)
Parsers (not covered Fall 2014)
- LPEG parser with captures
- LPEG parser with
semantic actions
- (for reference) Data Abstraction,
instructor's lecture notes
- Lua list module case study
- 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.)
- 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
- 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)
- Background reading on modular programming: Data Abstraction lecture notes
- (17 Nov) Lua Module Design Principles, instructor's lecture notes
- (17 Nov) Cell-based list module:
[module source]
[test driver]
- (for reference) Closure-and-table-based list module variant:
[module source]
[test driver]
- (for reference) Function-based cell list module variant:
[module source]
[test driver]
- (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]
- (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]
- (copies distributed, but not discussed directly) Carrie's Candy
Bowl ADT in Lua
- 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).
- 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
- Background reading on modular programming: Data Abstraction lecture notes
- ADT Problem Description
- ADT Semantics
- Description of Bag Concept
- Data
Representations
- Hashed version
(candybowl_hash.lua)
- Unsorted list version
(candybowl_list.lua)
- Test driver
(test_candybowl.lua)
- (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.
- (for reference) Movable and Named Objects case study (in Lua but
based on a Haskell case study by Thompson)
- 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).
- 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)
- Background reading on object-oriented programming languages:
Introduction to Object-Orientation,
instructor's lecture notes through the section titled "An Object
Model"
- Background reading on case study: Section 14.6 of Simon
Thompson. Haskell: The Craft of Functional Programming,
Third Edition, Addison Wesley, 2011
- 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.
- First Lua version: [source
(movable.lua)]
- Modularized version with improved class support
[class_support module]
[using class-support (movable2.lua)]
[test driver (movable2Test.lua)]
- Other older versions:
[Haskell source ]
[Scala source (partial) ]
- Examination 3
- (21 Nov) Emphasizes Lua-related topics covered since Exam 2
- (5 Dec) Discuss graded exam
- Discuss scope, functions, and storage management.
- 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
- Background reading: Chapter 7 (pages 204-231) of John
Mitchell's Concepts in Programming Languages, Cambridge
University Press, 2003
- (1 Dec) Slides
- Note: In Fall 2014, we only covered the material through
parameter passing. In the future, we need to cover the higher-order
function material.
- (3 Dec) Discuss solution to Assignment #4 (Sandwich DSL in Haskell)
- (8 Dec) Provide solution to Assignment #5 (Arithmetic Expression
Trees in Lua)
- End-of-semester examinations
- 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
- (Final Exam Period) 30 question multiple choice assessment exam
over entire semester
- (Final Exam Period) Three-hour comprehensive final examination
over entire semester
Reference Materials from Fall 2013 CSci 658 (Software
Language Engineering) class
- (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.)
- (for reference) Example recursive Lua functions adapted from
the Scheme versions in SICP Chapter 1
- Background reading: Chapter 1 of Abelson and Sussman's Structure and Interpretation of Computer Programs, Second
Edition, MIT Press, 1996
- Square root
(Newton's Method)
- Factorial
- Fibonacci
- Exponentiation
- Greatest common divisor
- Summation (takes
function arguments)
- Derivative (returns
function)
- (for reference) Natural number arithmetic case study
- Natural number package in Lua
(nats2.lua)
- Older Lua version with less distinct
data abstraction layers
- Similar programs in other languages:
[Java]
[Ruby]
[Scala (three versions, item 5)]
- (for reference) Complex number arithmetic modules in Lua
adapted from SICP Section 2.4.
- Background reading: Section 2.4 of Abelson and Sussman's Structure and Interpretation of Computer
Programs, Second Edition, MIT Press, 1996
Modules are repeated in each package in which they are used
- Rectangular coordinates modules
[arithmetic]
[rectangular representation]
[utilities]
[test driver]
- Polar coordinates modules:
[arithmetic]
[polar representation]
[utilities]
[test driver]
- Tagged data modules:
[arithmetic]
[data tagging]
[utilities]
[test driver]
- Data-directed programming modules:
[arithmetic]
[rectangular representation]
[polar representation]
[data tagging]
[utilities]
[test driver]
- Object-oriented modules:
[arithmetic]
[utilities]
[test driver]
- (for reference) Lua adaptation of Fowler's Lair Configuration DSL
- 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]
- Background reading on DSL patterns: DSL patterns catalog from
Martin Fowler's book Domain Specific Languages,
Addison Wesley, 2010
- Caveat: Some of these DSL programs may depend upon features
from Lua 5.1 that were changed in Lua 5.2.
Shared modules
- Class support module (same as in Movable Objects case study)
[class support module (class_support.lua)]
- Semantic Model
[model module (model.lua)]
[test driver (rules00.lua)]
Internal DSLs
- Global Function Sequence
[builder module (builder08.lua)]
[dsl script (rules08.lua)]
[test driver (test08.lua)]
- Class Method Function Sequence with Method Chaining
[builder module (builder11.lua)]
[dsl script (rules11.lua)]
[test driver (test11.lua)]
- Expression Builder with Method Chaining
[builder module (builder14.lua)]
[dsl script (rules14.lua)]
[test driver (test14.lua)]
- Nested Closures
[builder module (builder03.lua)]
[dsl script (rules03.lua)]
[test driver (test03.lua)]
- Expression Builder with Object Scoping and Method Chaining
[builder module (builder17.lua)]
[dsl script (rules17.lua)]
[test driver (test17.lua)]
- Literal Collection
[builder module (builder22.lua)]
[dsl script (rules22.lua)]
[test driver (test22.lua)]
External DSL
- LPEG Parser/Builder (no corresponding example in Fowler paper)
[builder module (builderLPEG1.lua)]
[dsl script (rulesLPEG1.dsl)]
[test driver (testLPEG1.lua)]
- (for reference) Sandwich DSL in Lua (related but not precisely
the same as the Haskell SandwichDSL above)
- Semantic model
module (sandwich_model.lua)
- DSL builder
module using function sequence pattern (sandwich_builder.lua)
- Test driver
(test_sandwichDSL.lua)
- (for reference) Lua Parsing Expression Grammar (LPEG) library
- Roberto Ierusalimschy's talk LPEG: A New Approach to
Pattern Matching [PDF slides]
[video]
- (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]
- (for reference) Kamin Interpreters in Lua Toolset (KILT)
[Compressed tar file]
- 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)]
-
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)
-
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]
-
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]
- (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