% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
  american,
]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math}
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
  pdftitle={CSci 555 : Functional Programming Spring Semester 2019 Lecture Notes},
  pdfauthor={H. Conrad Cunningham},
  pdflang={en-us},
  hidelinks,
  pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\newenvironment{Shaded}{}{}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.49,0.56,0.16}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\BuiltInTok}[1]{#1}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.53,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.73,0.13,0.13}{\textit{#1}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{#1}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.40,0.40,0.40}{#1}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.74,0.48,0.00}{#1}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.73,0.40,0.53}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.10,0.09,0.49}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textbf{\textit{#1}}}}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\usepackage{caption}
\DeclareCaptionLabelFormat{nolabel}{}
\captionsetup{labelformat=nolabel}
\ifxetex
  % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic)
  \usepackage{polyglossia}
  \setmainlanguage[variant=american]{english}
\else
  \usepackage[shorthands=off,main=american]{babel}
\fi
\ifluatex
  \usepackage{selnolig}  % disable illegal ligatures
\fi

\title{\href{../csci555.html}{CSci 555 : Functional Programming}\\
Spring Semester 2019\\
Lecture Notes}
\author{\textbf{\href{https://www.cs.olemiss.edu/~hcc}{H. Conrad
Cunningham}}}
\date{}

\begin{document}
\maketitle

{
\setcounter{tocdepth}{4}
\tableofcontents
}
Professor of \href{https://www.cs.olemiss.edu/}{Computer and Information
Science}\\
\href{https://engineering.olemiss.edu}{School of Engineering}\\
\href{http://www.olemiss.edu}{University of Mississippi}

I maintain these notes as text in the Pandoc's dialect of Markdown using
embedded LaTeX markup for the mathematical formulas and then translate
the notes to HTML, PDF, and other formats as needed.

\textbf{Browser Advisory}: The HTML version of this document requires
use of a browser that supports the display of MathML. A good choice as
of August 2020 is a recent version of Firefox from Mozilla.

\hypertarget{lecture-notes}{%
\section{Lecture Notes}\label{lecture-notes}}

\protect\hyperlink{current_lecture}{\textbf{Go To Current Lecture}}

\hypertarget{class-introduction}{%
\subsection{Class Introduction}\label{class-introduction}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\tightlist
\item
  \textbf{(23 Jan)} Discuss class organization and Syllabus:
  \href{../555syl_sp19.html}{HTML} -- \href{../555syl_sp19.pdf}{PDF}
\end{enumerate}

\hypertarget{programming-paradigms}{%
\subsection{Programming Paradigms}\label{programming-paradigms}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{1}
\item
  \textbf{(25, 28 Jan)} Survey the \emph{Primary Paradigms} (ELIFP
  Chapter 2)

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Chapter:
    \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/02_Programming_Paradigms.html}{HTML}
    --
    \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/02_Programming_Paradigms.pdf}{PDF}
  \item
    HTML slides:
    \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/ParadigmsSlides_Scala.html}{Scala
    version} --
    \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/ParadigmsSlides.html}{Original
    ELIFP}
  \item
    Scala examples:

    \begin{itemize}
    \tightlist
    \item
      \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingImp.scala}{Imperative
      example \texttt{CountingImp.scala}}
    \item
      \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingImp2.scala}{Imperative
      example \texttt{CountingImp2.scala}}
    \item
      \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingFun.scala}{Functional
      example \texttt{CountingFun.scala}}
    \item
      \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingProc.scala}{Procedural
      example \texttt{CountingProc.scala}}
    \item
      \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingMod.scala}{Modular
      example \texttt{CountingMod.scala}}
    \item
      \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingMod2.scala}{Modular
      example \texttt{CountingMod2.scala}}
    \end{itemize}
  \end{enumerate}
\item
  \textbf{(25 Jan)} Motivate the study of functional programming

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    \href{https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/02_Programming_Paradigms.html\#motivating-functional-programming-john-backus}{Excerpt
    from Backus' 1977 Turing Award Address}
  \item
    (for reference) 1977 Turing Award Address: John Backus.
    \href{localcopy/Backus_Turing_Award_Address.pdf}{Can Programming Be
    Liberated from the von Neumann Style? A Functional Style and Its
    Algebra of Programs}, \emph{Communications of the ACM} 21.8 (1978):
    613-641.
  \end{enumerate}
\item
  (for reference) Survey the \emph{Object-Based Paradigms} (ELIFP Ch. 3)

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Chapter:
    \href{https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch03/03_Object_Paradigms.html}{HTML}
    --
    \href{https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch03/03_Object_Paradigms.pdf}{PDF}
  \item
    HTML Slides:
    \href{https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch03/ObjectBasedSlides.html}{Original
    ELIFP}
  \item
    Scala example:
    \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch02/Scala/CountingOO.scala}{Object-Oriented
    \texttt{CountingOO.scala}}
  \item
    Additional notes: \href{OOSoftDev.html}{Object-Oriented Software
    Development}
  \item
    Additional slides on Using CRC Cards
    (Class-Responsibility-Collaboration): \href{UsingCRC.html}{HTML
    slides}

    \begin{itemize}
    \item
      Background: Kent Beck and Ward Cunningham.
      \href{http://c2.com/doc/oopsla89/paper.html}{A Laboratory for
      Teaching Object-Oriented Thinking}, In \emph{Proceedings of the
      OOPSLA'89 Conference}, ACM, 1989.
    \item
      Tutorial: Paul Gestwicki.
      \href{https://www.youtube.com/watch?v=otKUer13HnA}{CRC Card
      Analysis (YouTube)}, Ball State University, February 2016.
    \end{itemize}
  \end{enumerate}
\end{enumerate}

\hypertarget{basic-scala}{%
\subsection{Basic Scala}\label{basic-scala}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{4}
\item
  \textbf{(30 Jan, 1, 4, 6 Feb)} Introduce Scala to Java programmers

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Note: These Notes were adapted from: Michel Schniz and Philipp
    Haller,
    \href{http://docs.scala-lang.org/tutorials/scala-for-java-programmers.html}{A
    Scala Tutorial for Java Programmers}
  \item
    \emph{Notes on Scala for Java Programmers}:
    \href{ScalaForJava/ScalaForJava.html}{HTML} --
    \href{ScalaForJava/ScalaForJava.pdf}{PDF}

    Diagram for
    \href{https://docs.scala-lang.org/tour/unified-types.html}{Scala's
    unified type hierarchy}
  \item
    Scala source code from Notes:

    \begin{itemize}
    \tightlist
    \item
      \href{ScalaForJava/HelloWorld.scala}{\texttt{HelloWorld.scala}}
    \item
      \href{ScalaForJava/FrenchDate.scala}{\texttt{FrenchDate.scala}}
      and \href{ScalaForJava/MoreDates.scala}{\texttt{MoreDates.scala}}
    \item
      \href{ScalaForJava/Timer.scala}{\texttt{Timer.scala}} --
      \href{ScalaForJava/TimerAnonymous.scala}{\texttt{TimerAnonymous.scala}}
    \item
      \href{ScalaForJava/ComplexNumbers.scala}{\texttt{ComplexNumbers.scala}}
      --
      \href{ScalaForJava/ComplexNumbers2.scala}{\texttt{ComplexNumbers2.scala}}
      --
      \href{ScalaForJava/ComplexNumbers3.scala}{\texttt{ComplexNumbers3.scala}}
    \item
      \href{ScalaForJava/ExprCase.scala}{\texttt{ExprCase.scala}} --
      \href{ScalaForJava/ExprObj.scala}{\texttt{ExprObj.scala}}
    \item
      \href{ScalaForJava/OrderedDateTest.scala}{\texttt{OrderedDateTest.scala}}
    \end{itemize}
  \item
    (for reference) Miscellaneous overviews, cheat sheets, and tutorials

    \begin{itemize}
    \tightlist
    \item
      \href{https://docs.scala-lang.org/tour/tour-of-scala.html}{Tour of
      Scala}
    \item
      \href{https://www.jeffshaw.me/cheat/}{Java and Scala Comparison
      Cheatsheet}
    \item
      \href{http://www.cis.upenn.edu/~matuszek/Concise\%20Guides/Concise\%20Java\%20to\%20Scala.html}{Concise
      Java to Scala}
    \item
      \href{https://learnxinyminutes.com/docs/scala/}{Learn X in Y
      Minutes, Where X = Scala}
    \end{itemize}
  \end{enumerate}
\item
  \textbf{(1 Feb)} Distribute Assignment \#1. Due 13 Feb.
\end{enumerate}

\hypertarget{recursive-programming}{%
\subsection{Recursive Programming}\label{recursive-programming}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{6}
\item
  \textbf{(6, 8 Feb)} Examine \emph{Recursion Styles, Correctness, and
  Efficiency: Scala Version}

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Notes: \href{RecursionStyles/RecursionStylesScala.html}{HTML} --
    \href{RecursionStyles/RecursionStylesScala.pdf}{PDF}
  \item
    \href{RecursionStyles/RecursionStylesSlidesScala.html}{HTML Slides}
  \item
    Scala source code from Notes:
    \href{RecursionStyles/RecursionStyles.scala}{\texttt{RecursionStyles.scala}}
  \item
    (for reference) \href{http://en.wikipedia.org/wiki/Tail_call}{``Tail
    Call'' article on \emph{Wikipedia}}
  \end{enumerate}
\item
  \textbf{(8 Feb)} Take Quiz \#1 over semester content through
  \emph{Notes on Scala for Java}
\item
  (for reference) Examine functions adapted from SICP

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background reading: Chapter 1 of the classic SICP textbook

    Harold Abelson and Gerald J. Sussman with Julie Sussman.
    \emph{Structure and Interpretation of Computer Programs}, Second
    Edition, MIT Press, 1996:

    \begin{itemize}
    \tightlist
    \item
      \href{http://mitpress.mit.edu/sicp/}{book site at MIT Press}
    \item
      \href{http://mitpress.mit.edu/sicp/full-text/book/book.html}{HTML
      book}
    \item
      \href{http://sicpebook.wordpress.com/}{SICP ebook site}
    \item
      \href{otherFP/SICP_allcode}{local copy of source code}
    \end{itemize}
  \item
    First-order functions in Scala

    \begin{itemize}
    \tightlist
    \item
      Square root (Newton's Method) version 1 with all public functions:
      \href{SICP_examples/Scala/sqrt.scala}{Scala source}
    \item
      Square root (Newton's Method) version 2 with nested function
      definitions: \href{SICP_examples/Scala/sqrt2.scala}{Scala source}
    \item
      Factorial --- discussed in Recursion Styles notes above:
      \href{SICP_examples/Scala/factorial.scala}{Scala source}
    \item
      Fibonacci --- discussed in Recursion Styles notes above:
      \href{SICP_examples/Scala/fibonacci.scala}{Scala source}
    \item
      Exponentiation --- discussed in Recursion Styles notes above:
      \href{SICP_examples/Scala/exponentiation.scala}{Scala source}
    \item
      Greatest common divisor:
      \href{SICP_examples/Scala/gcd.scala}{Scala source}
    \end{itemize}
  \item
    Higher-order functions in Scala

    \begin{itemize}
    \tightlist
    \item
      Summation (takes function arguments):
      \href{SICP_examples/Scala/summation.scala}{Scala source}\\
    \item
      Derivative (returns function result):
      \href{SICP_examples/Scala/derivative.scala}{Scala source}
    \end{itemize}
  \end{enumerate}
\end{enumerate}

\hypertarget{types-and-functional-data-structures}{%
\subsection{Types and Functional Data
Structures}\label{types-and-functional-data-structures}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{9}
\item
  \textbf{(11 Feb)} Survey \emph{Type System Concepts}

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Notes: \href{TypeConcepts/TypeSystemConcepts.html}{HTML} --
    \href{TypeConcepts/TypeSystemConcepts.pdf}{PDF}
  \item
    \href{TypeConcepts/TypeConceptsSlides.html}{HTML slides}
  \end{enumerate}
\item
  \textbf{(13, 15, 18, 20, 22, 25 Feb, 1 Mar)} Study \emph{Functional
  Data Structures}

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background reading: ``Functional Data Structures,'' Chapter 3, Paul
    Chiusano and Runar Bjarnason, \emph{Functional Programming in
    Scala}, Manning, 2015 (i.e.~the Red Book)
  \item
    Lecture notes on Chapter 3 (primarily on \texttt{List} type):
    \href{FPS03/FunctionalDS.html}{HTML} --
    \href{FPS03/FunctionalDS.pdf}{PDF}
  \item
    Scala source: \href{FPS03/List2.scala}{\texttt{List2.scala}}
  \item
    Reference: See the discusion of the object-based paradigms above for
    general information on the object-oriented nature of Scala.
  \end{enumerate}
\item
  \textbf{(16 Feb)} Distribute Assignment \#2. Originally due 28
  February, but extended to 4 March.
\item
  \textbf{(22 Feb)} Take Quiz \#2 over \emph{Recursion Styles},
  \emph{Type System Concepts}, and Sections 3.1-3.2 of \emph{Functional
  Data Structures} notes. (Returned on 25 Feb.)
\item
  \textbf{(27 Feb, 1 Mar)} Examine a natural number arithmetic case
  study

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    (for reference) Background on Peano arithmetic and design patterns

    \begin{itemize}
    \tightlist
    \item
      \href{http://en.wikipedia.org/wiki/Peano_axioms}{``Peano Axioms''
      article on Wikipedia}
    \item
      \href{http://mathworld.wolfram.com/PeanosAxioms.html}{``Peano's
      Axioms'' on Wolfram MathWorld}
    \item
      \href{https://sourcemaking.com/design_patterns}{Source Making
      Design Patterns catalog} -- for information on the Composite,
      Singleton, and Null Object design patterns used in this case study
    \end{itemize}
  \item
    Scala versions (2008, 2012, 2019)

    \begin{itemize}
    \item
      Functional object-oriented with ordinary classes:
      \href{Nat/Scala/TestNats.scala}{Scala source}

      This version uses an object-oriented hierarchy of classes/objects
      organized according to the Composite, Singleton, and Null Object
      software design patterns. Once created, the Nat objects are
      immutable. The operations do not modify the state of an object;
      they create new objects with the modified state. It carries out
      computations by ``passing messages'' among the objects, taking
      advantage of subtype polymorphism (dynamic binding) to associate
      method calls with the correct implementation. This version also
      encapsulates the state within the objects in the hierarchy.
    \item
      Functional module with case classes:
      \href{Nat/Scala/TestCaseExtNats.scala}{Scala source}

      This version uses a Scala algebraic data type (defined using a
      sealed trait and case class/objects) with a group of functions
      defined in the companion object for the trait. It is organized
      similarly to the List algebraic data type from the Functional Data
      Structures chapter. This version uses pattern matching to identify
      the correct operation functionality. By using cases
      classes/objects, this version exposes the state outside the
      hierarchy.
    \item
      Functional object-oriented with case classes:
      \href{Nat/Scala/TestCaseObjNats.scala}{Scala source}

      This version is in-between the implementations above. It uses the
      traditional OO structure, but uses case classes/objects instead of
      ordinary objects. It uses subtype polymorphism for the left
      argument and uses pattern matching for the right argument to
      select the correct operation functionality. By using cases
      classes/objects, this version exposes the state outside the
      hierarchy.
    \end{itemize}
  \item
    Elixir version (2015):

    \begin{itemize}
    \tightlist
    \item
      \href{Nat/Elixir/Nat.ex}{Nat module}
    \item
      \href{Nat/Elixir/Nat_Test.ex}{test module}
    \item
      \href{Nat/Elixir/Nat.exs}{test script}
    \end{itemize}
  \item
    Lua version (2013, 2014): \href{Nat/Lua/nats2.lua}{source
    \texttt{nats2.lua}}
  \item
    Ruby version (2006): \href{Nat/Ruby/Nat.txt}{source \texttt{Nat.rb}}
  \item
    Java version (2004), simpler, no generics:

    \begin{itemize}
    \tightlist
    \item
      \href{Nat/Java/Nat.java}{abstract base class \texttt{Nat}}
    \item
      \href{Nat/Java/Zero.java}{subclass \texttt{Zero}}
    \item
      \href{Nat/Java/Succ.java}{subclass \texttt{Succ}}
    \item
      \href{Nat/Java/Err.java}{subclass \texttt{Err}}
    \item
      \href{Nat/Java/TestNat.java}{main program \texttt{TestNat}}
    \end{itemize}
  \end{enumerate}
\end{enumerate}

\hypertarget{references-patterns-and-testing}{%
\subsection{References: Patterns and
Testing}\label{references-patterns-and-testing}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{14}
\item
  (for reference) Survey design patterns

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Introduction to Patterns: \href{Patterns/Patterns.html}{HTML} --
    \href{Patterns/Patterns.pdf}{PDF} --
    \href{Patterns/Intro_Patterns.html}{HTML slides}
  \item
    John Vlissides. Designing with Patterns, In \emph{Pattern Hatching:
    Design Patterns Applied}, Addison-Wesley, 1998:
    \href{Patterns/sle_Designing_with_Patterns.ppt}{Powerpoint}
  \item
    Patterns notes and slides:

    \begin{itemize}
    \tightlist
    \item
      Pipes and Filters architectural pattern:
      \href{Patterns/Pipes.html}{HTML} -- \href{Patterns/Pipes.pdf}{PDF}
      -- \href{Patterns/sle_Pipes_Filters_Pattern.ppt}{Powerpoint}
    \item
      \href{Patterns/sle_Factory_Method_Pattern.ppt}{Factory Method
      design pattern (Powerpoint)}
    \item
      \href{Patterns/sle_Strategy_Pattern.ppt}{Strategy design pattern
      (Powerpoint)}
    \item
      \href{Patterns/sle_Template_Method_Pattern.ppt}{Template Method
      design pattern (Powerpoint)}
    \end{itemize}
  \item
    Additional references:

    \begin{itemize}
    \tightlist
    \item
      \href{https://sourcemaking.com/design_patterns}{Source Making
      Design Patterns catalog}
    \item
      Siemens book: Frank Buschmann, Regine Meunier, Hans Rohnert, Peter
      Sommerlad, and Michael Stal. \emph{Pattern-Oriented Software
      Architecture: A System of Patterns}, Wiley, 1996.
    \item
      ``Gang of Four'' (GoF) book: Erich Gamma, Richard Helm, Ralph
      Johnson, and John Vlissides. \emph{Design Patterns: Elements of
      Reusable Object-Oriented Software}, Addison Wesley, 1995.
      Patterns*, Wiley, 1996.
    \item
      Mary Shaw.
      \href{http://www.google.com/url?sa=t\&source=web\&ct=res\&cd=9\&ved=0CDMQFjAI\&url=http\%3A\%2F\%2Fciteseerx.ist.psu.edu\%2Fviewdoc\%2Fdownload\%3Fdoi\%3D10.1.1.131.4205\%26rep\%3Drep1\%26type\%3Dpdf\&ei=pA7XS82YIYHMNN_HqPsF\&usg=AFQjCNGBwu48uiRxFJO1pgCIi94jSdu4FA\&sig2=Ut3P0nKWRUwqByT_CFsIZw}{Some
      Patterns for Software Architecture}, In John M. Vlissides, James
      O. Coplien, and Norman L. Kerth, editors, \emph{Pattern Languages
      of Program Design 2}, Addison Wesley, 1996, pages 255-270. --
      \href{localcopy/Shaw_Patterns_Arch.pdf}{local}
    \end{itemize}
  \end{enumerate}
\item
  (for reference) Examine software testing concepts

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Software Testing Concepts, Chapter 11, \emph{Exploring Language with
    Interpreters and Functional Programming} (ELIFP):
    \href{https://www.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch11/11_Testing_Concepts.html}{HTML}
    --
    \href{https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch11/11_Testing_Concepts.pdf}{PDF}
  \item
    Testing Haskell Programs, Chapter 12, \emph{Exploring Language with
    Interpreters and Functional Programming} (ELIFP):
    \href{https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch12/12_Testing_Haskell.html}{HTML}
    --
    \href{https://john.cs.olemiss.edu/~hcc/csci450/ELIFP/Ch12/12_Testing_Haskell.pdf}{PDF}
  \item
    \href{https://docs.pytest.org/en/latest/}{pytest Python testing
    framework}
  \end{enumerate}
\end{enumerate}

\hypertarget{functional-error-handling}{%
\subsection{Functional Error Handling}\label{functional-error-handling}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{16}
\item
  \textbf{(4, 6, 8, 18, 20 Mar)} Explore \emph{Handling Errors without
  Exceptions}

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background reading: ``Handling Errors without Exceptions,'' Chapter
    4, Paul Chiusano and Runar Bjarnason, \emph{Functional Programming
    in Scala}, Manning, 2015 (i.e.~the Red Book)
  \item
    Lecture notes on Chapter 4: \href{FPS04/ErrorHandling.html}{HTML} --
    \href{FPS04/ErrorHandling.pdf}{PDF}
  \item
    Scala source code from notes:
    \href{FPS04/Option2.scala}{\texttt{Option2.scala}} --
    \href{FPS04/Either2.scala}{\texttt{Either2.scala}}
  \item
    Scala examples for parameter-passing discussion:

    \begin{itemize}
    \tightlist
    \item
      Closures:
      \href{Closures/ClosureExample.scala}{\texttt{ClosureExample.scala}}
      -- \href{Closures/ClosureExample.out}{\texttt{ClosureExample.out}}
    \item
      Thunks:
      \href{Closures/ThunkExample.scala}{\texttt{ThunkExample.scala}} --
      \href{Closures/ThunkExample.out}{\texttt{ThunkExample.out}}
    \end{itemize}
  \item
    Scala example for wrapping exceptions with \VERB|\NormalTok{Option}|
    and \VERB|\NormalTok{Either}|:
    \href{FPS04/WrapException.scala}{\texttt{WrapException.scala}}
  \end{enumerate}
\item
  \textbf{(8, 18 Mar)} Discuss Semester Project
\item
  \textbf{(11-15 Mar) Enjoy Spring Break}
\item
  \textbf{(18, 20 Mar)} Continue discussion of notes on \emph{Handling
  Errors without Exceptions}
\item
  \textbf{(18, 20, 22 Mar)} Continue discussion of Semester Project;
  distribute \href{../homework/555project.html}{description} on 22 March
\item
  \textbf{(25 Mar)} Take \emph{double-point} Quiz \#3 over notes on
  \emph{Functional Data Structures} and \emph{Handling Errors without
  Exceptions}
\item
  \textbf{(29 Mar)} Return and discuss Quiz \#3:
  \href{Quiz03/Quiz03Test.scala}{\texttt{Quiz03Test.scala}} --
  \href{Quiz03/Quiz03Test.scala}{\texttt{List3.scala}}
\end{enumerate}

\hypertarget{abstract-data-types}{%
\subsection{Abstract Data Types}\label{abstract-data-types}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{23}
\item
  \textbf{(22 Mar)} Distribute description of
  \href{../homework/555project.html}{Assignment \#3} (Mealy Machine
  Simulator); (29 Mar) extend deadline

  See a similar, but imperative and object-oriented, implementation
  below for the \protect\hyperlink{stateMachineSemantic}{Semantic Model}
  (part e) for the \protect\hyperlink{stateMachineDSL}{State Machine}
  used for for Fowler's ``Secret Panel'' Controller External DSLs
\item
  \textbf{(20, 22, 27, 29 Mar; 1, 3, 5 Apr)} Explore \emph{Abstract Data
  Types in Scala} using the Labeled Digraph ADT case study

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background reading on abstract data types

    \begin{itemize}
    \tightlist
    \item
      \href{http://en.wikipedia.org/wiki/Abstract_data_type}{``Abstract
      data type'' article} on Wikipedia
    \item
      Nell Dale and Henry Walker. ``Abstract Specification Techniques,''
      Chapter 1, In \emph{Abstract Data Types: Specifications,
      Implementations, and Applications}, pp.~1-34, D. C. Heath, 1996.
    \item
      William R. Cook.
      \href{http://www.cs.utexas.edu/~wcook/papers/OOPvsADT/CookOOPvsADT90.pdf}{Object-Oriented
      Programming Versus Abstract Data Types}, In \emph{Proceedings of
      the REX Workshop/School on the Foundations of Object-Oriented
      Languages (FOOL)}, LNCS 489, pp.~151-178, Springer-Verlag, 1990.
      -- \href{localcopy/CookOOPvsADT90.pdf}{local copy}
    \item
      William R. Cook.
      \href{http://www.cs.utexas.edu/~wcook/Drafts/2009/essay.pdf}{On
      Understanding Data Abstraction Revisited}, In \emph{Proceedings of
      OOPSLA}, October 2009: --
      \href{localcopy/understanding_Data_Abstraction_Revisited.pdf}{local
      copy}
    \end{itemize}
  \item
    Background reading on directed graph ADTs

    \begin{itemize}
    \tightlist
    \item
      Nell Dale and Henry Walker. ``Directed Graphs or Digraphs,''
      Chapter 10, In Abstract Data Types: Specifications,
      Implementations, and Applications, pp.~439-469, D. C. Heath, 1996.
    \item
      Conrad Barski. ``Building a Text Game Engine,'', Chapter 5, In
      Land of Lisp: Learn to Program in Lisp, One Game at a Time, pp.
      69-84, No Starch Press, 2011. The Common Lisp example in this
      chapter is similar to the classic Adventure game; the underlying
      data structure is a labeled digraph.
    \end{itemize}
  \item
    Notes on \emph{Abstract Data Types in Scala}:
    \href{Digraph/Scala/AbstractDataTypes.html}{HTML} --
    \href{Digraph/Scala/AbstractDataTypes.pdf}{PDF}
  \item
    Scala solutions using method-chaining abstract data type API

    \begin{itemize}
    \tightlist
    \item
      Abstract data type specification and Scala trait (interface):\\
      \href{Digraph/Scala/Digraph.scala}{ADT interface trait
      \texttt{Digraph}}
    \item
      List representation for vertices and edges:\\
      \href{Digraph/Scala/DigraphList.scala}{class \texttt{DigraphList}}
      -- \href{Digraph/Scala/Test_DigraphList.scala}{test program
      \texttt{Test\_DigraphList.scala}}
    \item
      Map (HashMap) representation for graph:\\
      \href{Digraph/Scala/DigraphMap.scala}{class \texttt{DigraphMap}}
      -- \href{Digraph/Scala/Test_DigraphMap.scala}{test program
      \texttt{Test\_DigraphMap.scala}}
    \end{itemize}
  \item
    (for reference) Haskell solutions

    \begin{itemize}
    \tightlist
    \item
      List representation for vertices and edges:\\
      \href{Digraph/Haskell/DigraphADT_List.hs}{module} --
      \href{Digraph/Haskell/DigraphADT_TestList.hs}{test module}
    \item
      Map representation for graph:\\
      \href{Digraph/Haskell/DigraphADT_Map.hs}{module
      \texttt{DigraphADT\_Map}} --
      \href{Digraph/Haskell/DigraphADT_TestMap.hs}{test module}
    \end{itemize}
  \item
    (for reference) Elixir solutions

    \begin{itemize}
    \tightlist
    \item
      Tuple and list representation for graph:\\
      \href{Digraph/Elixir/Digraph_List.ex}{module} --
      \href{Digraph/Elixir/Digraph_Test.exs}{test script}
    \end{itemize}
  \item
    (for reference) Notes on
    \href{DataAbstraction/DataAbstraction.html}{Data Abstraction} (Parts
    of these notes have been integrated into the notes on \emph{Abstract
    Data Types in Scala} above.)

    (not updated 2019) Notes on
    \href{DataAbstraction/DataAbstraction_Java_ADTs.html}{Data
    Abstraction---Java Supplement} (These notes describe nongeneric Java
    implementations, circa 1997, of the \texttt{Stack} and \texttt{Day}
    ADTs specified in the Data Abstraction notes above.)
  \item
    (for reference) Lecture Notes on \href{ModularDesign.html}{Modular
    Design} (Parts of these notes have been integrated into the notes on
    \emph{Abstract Data Types in Scala} above.)
  \item
    (for reference) H. C. Cunningham, Y. Liu, and J. Wang.
    ``\href{localcopy/Cunningham_Table_Abstraction.pdf}{Designing a
    Flexible Framework for a Table Abstraction},'' In Y. Chan, J.
    Talburt, and T. Talley, editors, \emph{Data Engineering: Mining,
    Information, and Intelligence}, pp.~279-314, Springer, 2010.
  \item
    (for reference) Classic papers by David L. Parnas and associates:

    \begin{itemize}
    \tightlist
    \item
      Abstract interface: Kathryn Heninger Britton, R. Alan Parker, and
      David L. Parnas. \href{localcopy/Parnas_Abstract_Interfaces.pdf}{A
      Procedure for Designing Abstract Interfaces for Device Interface
      Modules}, In \emph{Proceedings of the 5th International Conference
      on Software Engineering}, pp.~195-204, March 1981.
    \item
      Information hiding: David L. Parnas.
      \href{localcopy/Parnas_Criteria_Decomposing.pdf}{On the Criteria
      To Be Used in Decomposing Systems into Modules},
      \emph{Communications of the ACM}, Vol. 15, No.~12, pp.~1053-1058,
      1972.
    \item
      Software families: David L. Parnas.
      \href{localcopy/Parnas_Families.pdf}{On the Design and Development
      of Program Families}, \emph{IEEE Transactions on Software
      Engineering}, Vol. SE-2, No.~1, pp.~1-9, March 1976.
    \item
      Extensible system design: David L. Parnas.
      \href{localcopy/Parnas_Extension_Contraction.pdf}{Designing
      Software for Ease of Extension and Contraction}, \emph{IEEE
      Transactions on Software Engineering}, Vol. SE-5, No.~1,
      pp.~128-138, March 1979.
    \item
      Modular specification of large systems: David L. Parnas, P. C.
      Clements, and D. M. Weiss.
      \href{localcopy/Parnas_Modular_Structure.pdf}{The Modular
      Structure of Complex Systems}, \emph{IEEE Transactions on Software
      Engineering}, Vol. SE-11, No.~3, pp.~259-266, March 1985.
    \end{itemize}
  \end{enumerate}
\item
  \textbf{(8 Apr)} Take Quiz \#4 over \emph{Abstract Data Types in
  Scala} above; returned 10 April@. \textbf{(10 Apr)} Post Challenge
  Assignment \#4
\item
  \textbf{(10 Apr)} Host guest lecture by J. P. Marum on reactive
  programming (20 minutes)
\item
  \textbf{(10 Apr)} Distribute Optional Assignment \#4

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Sandwich DSL Implementation (one opiton on assignment)

    \begin{itemize}
    \tightlist
    \item
      Scala \href{SandwichDSL/Scala/SandwichDSL_Scala.html}{SandwichDSL
      Case Study}, instructor's lecture notes (with exercises) --
      \href{SandwichDSL/Scala/SandwichDSL_base.scala}{Scala code}
    \item
      Haskell \href{SandwichDSL/Haskell/SandwichDSL.html}{SandwichDSL
      Case Study}, instructor's lecture notes (with exercises) --
      \href{SandwichDSL/Haskell/SandwichDSL_base.hs}{Haskell code}
    \end{itemize}
  \end{enumerate}
\end{enumerate}

\hypertarget{lazy-data-structures}{%
\subsection{Lazy Data Structures}\label{lazy-data-structures}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{28}
\item
  \textbf{(10 Apr; 1, 3 May)} Explore \emph{Strictness and Laziness}

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background reading: ``Strictness and Laziness,'' Chapter 5, Paul
    Chiusano and Runar Bjarnason, \emph{Functional Programming in Scala}
  \item
    Lecture notes on Chapter 5: \href{FPS05/Laziness.html}{HTML} --
    \href{FPS05/Laziness.pdf}{PDF}
  \item
    Scala source code from notes:
    \href{FPS05/StreamC.scala}{\texttt{StreamC.scala}}
  \item
    (for reference) John Hughes, \href{localcopy/whyfp.pdf}{Why
    Functional Programming Matters}, \emph{Computer Journal}, Vol. 32,
    No.~2, pp.~98-107, 1989.
  \item
    (for reference) \href{EvaluationConcepts.html}{Notes on Functional
    Program Evaluation Concepts} -- not updated 2019
  \end{enumerate}
\end{enumerate}

\hypertarget{semester-project-presentations}{%
\subsection{Semester Project
Presentations}\label{semester-project-presentations}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{29}
\item
  \textbf{(15 Apr)} Yunshu Wang and Silu Zhang: Spark Fundamentals
\item
  \textbf{(17 Apr)} Nusrat Armin and Carla Rego: PySpark and Jupyter
\item
  \textbf{(22 Apr)} Matthew Toche: Scala Futures and Promises
\item
  \textbf{(24 Apr)} Chris Donelson and Deep Sharma: Squants Package
\item
  \textbf{(26 Apr)} Amulya Arora (and Layton Jones): Software Testing
\item
  \textbf{(29 Apr)} Saman Ray: Akka Actors in Scala
\item
  \textbf{(3 May)} Layton Jones Project Presentation (Software Testing)
\end{enumerate}

\hypertarget{end-of-semester}{%
\subsection{End of Semester}\label{end-of-semester}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{36}
\item
  \textbf{(1 May)} Continue exploring \emph{Strictness and Laziness}
  \protect\hyperlink{laziness}{\textbf{above}}
\item
  \textbf{(3 May)} Take Quiz \#5 over Chapter 5 \emph{Strictness and
  Laziness}
\item
  \textbf{(6 May: Noon -- 3:00 p.m.)} Optional final exam: Contact
  instructor by Noon on 3 May if you plan to take this exam!
\item
  \textbf{END of Spring 2019 semester:} Enjoy Summer!
\end{enumerate}

\hypertarget{more-on-abstract-data-types}{%
\subsection{More on Abstract Data
Types}\label{more-on-abstract-data-types}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{40}
\item
  (for reference) Use the Digraph ADT module (to build a game)

  TODO: Create a Scala version of this example.

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    \href{Wizard/Elixir/wizards_game.ex}{Wizard's Adventure game, Elixir
    Version 1}

    This game is based on Chapters 5, 6, and 17 of Conrad Barski's
    \emph{Land of Lisp: Learn to Program in Lisp, One Game at a Time},
    No Starch Press, 2011.

    Concepts: Importing Elixir modules, use of Elixir features such as
    atoms, maps, pipes, and complex pattern matching, designing
    functional programs to handle global state; use of Elixir API
    modules \texttt{Enum}, \texttt{Dict}, \texttt{List},
    \texttt{Keyword}, \texttt{String}, \texttt{IO}, etc.).
  \item
    \href{Wizard/Elixir/wizards_game2a.ex}{Wizard's Adventure game,
    Elixir Version 2}

    This version uses a higher-order function to generate game actions
    and improved handling of the game state.

    Additional concepts: Use of higher-order factory function to
    generate functions from first- and higher-order arguments; storing
    functions in a data structure, calling functions stored in a data
    structure; use of mutator (setter) and accessor (getter) functions
    for the data structure.
  \end{enumerate}
\item
  (for reference) Examine the CookieJar ADT case study (and other
  examples)

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    \href{CookieJar/Scala/CookieJar_problem.html}{Cookie Jar ADT Problem
    Description}
  \item
    \href{CookieJar/Scala/bag.html}{Description of Bag Concept} (used in
    specification)
  \item
    Immutable CookieJar ADT Implementation in Scala
    (\texttt{ICookieJar.scala}) -- uses method-chaining functional style
    with immutable objects

    \begin{itemize}
    \tightlist
    \item
      ADT specification as Scala trait:
      \href{CookieJar/Scala/immutable/ICookieJar.scala}{Scala source}\\
    \item
      Using Scala List:
      \href{CookieJar/Scala/immutable/ICookieJarList.scala}{Scala
      source}\\
    \item
      Using Scala HashMap:
      \href{CookieJar/Scala/immutable/ICookieJarMap.scala}{Scala
      source}\\
    \item
      Using Scala List of Tuples:
      \href{CookieJar/Scala/immutable/ICookieJarTupleList.scala}{Scala
      source}\\
    \item
      Blackbox test script:
      \href{CookieJar/Scala/immutable/ICookieJarTest.scala}{Scala
      source}
    \end{itemize}
  \item
    Mutable CookieJar ADT Implementation in Scala
    (\VERB|\NormalTok{CookieJar}|) -- uses object-oriented style with
    mutable state

    \begin{itemize}
    \tightlist
    \item
      ADT specification as Scala trait:
      \href{CookieJar/Scala/mutable/CookieJar.scala}{Scala source}
    \item
      Using Scala List:
      \href{CookieJar/Scala/mutable/CookieJarList.scala}{Scala source}
    \item
      Using Scala List of tuples:
      \href{CookieJar/Scala/mutable/CookieTupleList.scala}{Scala
      source}\\
    \item
      Using Scala ArrayBuffer:
      \href{CookieJar/Scala/mutable/CookieJarArrayBuffer.scala}{Scala
      source}
    \item
      Using Scala HashMap:
      \href{CookieJar/Scala/mutable/CookieJarMap.scala}{Scala source}
    \item
      Using Scala array:
      \href{CookieJar/Scala/mutable/CookieJarArray.scala}{Scala source}
    \item
      Blackbox test script:
      \href{CookieJar/Scala/mutable/CookieJarTest.scala}{Scala source}\\
    \item
      Similar specification and Ruby program:
      \href{CookieJar/Ruby/CookieJarRuby.txt}{text}
    \end{itemize}
  \item
    Carrie's Candy Bowl ADT in Lua -- gives the specification of a Candy
    Bowl ADT (similar to the Cookie Jar above) and two implementation
    using Lua modules

    \begin{itemize}
    \tightlist
    \item
      \href{CandyBowl/Lua/candybowl_problem.html}{Carrie's Candy Bowl
      ADT Problem Description}
    \item
      \href{CandyBowl/Lua/candybowl_semantics.html}{ADT Semantics}
    \item
      \href{CandyBowl/Lua/candybowl_data_representation.html}{Data
      representations}
    \item
      \href{CandyBowl/Lua/candybowl_hash.lua}{Hashed version
      \texttt{candybowl\_hash.lua}}
    \item
      \href{CandyBowl/Lua/candybowl_list.lua}{Unsorted List version
      \texttt{candybowl\_list.lua}}
    \item
      \href{CandyBowl/Lua/test_candybowl.lua}{Test driver
      \texttt{test\_candybowl.lua}}
    \end{itemize}
  \item
    Carrie's Candy Bowl ADT in Scala

    \begin{itemize}
    \tightlist
    \item
      \href{CandyBowl/Scala/CandyBowl.scala}{trait \texttt{CandyBowl}}
      to define abstract data type interface
    \item
      \href{CandyBowl/Scala/CandyBowlList.scala}{class
      \texttt{CandyBowlList}} to define a list-based implementation
    \end{itemize}
  \item
    Older mutable Java abstract data type implementations. These use
    nongeneric Java implementations done during the 1997-98 timeframe

    \begin{itemize}
    \tightlist
    \item
      \href{SoftwareInterfaces/Queue.html}{Queue ADT} -- gives a
      specification for a Queue ADT and implements the ADT directly as
      two concrete classes
    \item
      \href{SoftwareInterfaces/RankedSequence.html}{Ranked Sequence ADT}
      -- gives a specification for a Ranked Sequence ADT (similar to
      \texttt{ArrayList} or \texttt{Vector})
    \end{itemize}
  \end{enumerate}
\end{enumerate}

\hypertarget{not-fully-updated}{%
\subsection{NOT FULLY UPDATED}\label{not-fully-updated}}

\hypertarget{games}{%
\subsubsection{Games}\label{games}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{42}
\item
  (for reference) Examine the Dice of Doom game

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background: Conrad Barski. \emph{Land of Lisp: Learn to Program in
    Lisp, One Game at a Time}, No Starch Press, 2011.
  \item
    \href{Dice_of_Doom/Elixir/dice_of_doom_v1a.ex}{Dice of Doom, Elixir
    Version 1a}

    This is a basic eagerly evaluated version (similar to that developed
    on pages 303-325 of \emph{Land of Lisp}). This version supports
    either two human players or a human player and a simple, minimax
    search-based ``AI'' (artificial intelligence) opponent.
  \item
    \href{Dice_of_Doom/Elixir/dice_of_doom_v1b.ex}{Dice of Doom, Elixir
    Version 1b}

    This is an eager version above with an attempt at memoization of
    functions \texttt{neighbors} and \texttt{game\_tree} using the
    Elixir \texttt{Agent} modules.
  \item
    \href{Dice_of_Doom/Elixir/dice_of_doom_v2a.ex}{Dice of Doom, Elixir
    Version 2a,}

    This is a lazy version using Elixir \texttt{Stream} data structures
    (but without the memoization optimizations). This is based on
    version 1a above plus the discussion from pages 384-389 in chapter
    18 of \emph{Land of Lisp}. This version implements a limited depth
    minimax search, but it does not implement the artificial
    intelligence heuristics given in the last part of chapter 18.
  \end{enumerate}
\end{enumerate}

\hypertarget{domain-specific-languages}{%
\subsubsection{Domain-Specific
Languages}\label{domain-specific-languages}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{43}
\item
  (TBD) Discuss domain-specific languages and Sandwich DSL case study

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    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
  \item
    Notes: \href{DomainSpecificLanguages.html}{Domain-Specific
    Languages}
  \item
    Sandwich DSL Implementation

    \begin{itemize}
    \tightlist
    \item
      Scala \href{SandwichDSL/Scala/SandwichDSL_Scala.html}{SandwichDSL
      Case Study}, instructor's lecture notes (with exercises) --
      \href{SandwichDSL/Scala/SandwichDSL_base.scala}{Scala code}
    \item
      Haskell \href{SandwichDSL/Haskell/SandwichDSL.html}{SandwichDSL
      Case Study}, instructor's lecture notes (with exercises) --
      \href{SandwichDSL/Haskell/SandwichDSL_base.hs}{Haskell code}
    \end{itemize}
  \item
    Sandwich DSL in Lua (similar but not identical to Haskell
    description

    \begin{itemize}
    \tightlist
    \item
      \href{SandwichDSL/Lua/sandwich_model.lua}{Semantic model module
      \texttt{sandwich\_model.lua}}
    \item
      \href{SandwichDSL/Lua/sandwich_builder.lua}{DSL builder module
      using function sequence pattern `sandwich\_builder.lua}
    \item
      {[}Test driver{]} `test\_sandwichDSL.lua
      {]}(\textless SandwichDSL/Lua/test\_sandwichDSL.lua\textgreater{}
    \end{itemize}
  \end{enumerate}
\item
  (for reference) Discuss State Machine External DSLs based on Martin
  Fowler's Secret Panel Controller (State Machine) DSLs

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Backgrond: Martin Fowler. \emph{Domain Specific Languages}, Addison
    Wesley, 2011.

    \begin{itemize}
    \tightlist
    \item
      Fowler introduces the running example, the Secret Panel Controller
      (State Machine) case study, in
      \href{http://www.informit.com/articles/article.aspx?p=1592379}{DSL
      Chapter 1})
    \item
      Fowler DSL Chapter 1
      ``\href{http://www.informit.com/articles/article.aspx?p=1592379}{An
      Introductory Example}''
    \item
      Fowler DSL Chapter 2 ``Using Domain-Specific Languages''
    \item
      Fowler DSL Chapter 3 ``Implementing DSLs''
    \item
      Fowler DSL Chapter 5 ``Implementing an External DSL''
    \item
      Fowler DSL Chapter 8 ``Code Generation''
    \item
      Fowler DSL Chapter 11 ``Semantic Model''
    \item
      Fowler DSL Chapter 17 ``Delimiter-Directed Translation''
    \item
      Fowler DSL Chapter 18 ``Syntax-Directed Translation''
    \item
      Fowler DSL Chapter 21 ``Recursive Descent Parser''
    \item
      Fowler DSL Chapter 21 ``Parser Generator''
    \item
      Fowler DSL Chapter 22 ``Parser Combinator''
    \item
      Fowler DSL Chapter 51 ``State Machine''
    \item
      Fowler DSL Chapter 52 ``Transformer Generation''
    \item
      Fowler DSL Chapter 55 ``Model Aware Generation''
    \item
      Fowler DSL Chapter 56 ``Model Ignorant Generation''
    \item
      Fowler's \href{http://martinfowler.com/dslCatalog/}{List of DSL
      Patterns} from DSL book.
    \end{itemize}
  \item
    Other items from the instructor's notes

    \begin{itemize}
    \tightlist
    \item
      \href{MealyMachineSimulator.html}{Mealy Machine Description and
      Exercise} gives a formal description of this kind of state machine
    \item
      \href{https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/11ExprLangParsing.html\#recursive-descent-parsing}{Recursive
      Descent Parsing} gives a set of (Haskell) program templates for
      recursive descent parsers
    \item
      \href{https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/11ExprLangParsing.html\#parsing-combinators}{Parsing
      Combinators} describes a preliminary set of (Haskell) parsing
      combinators for recursive descent parsers
    \item
      Wikipedia entry on
      \href{https://en.wikipedia.org/wiki/Parser_combinator}{Parsing
      Combinator}
    \end{itemize}
  \item
    Scala notes

    \begin{itemize}
    \tightlist
    \item
      I developed the Scala versions in 2009 by referring to an in-work
      version of Fowler's book on his website, so they may not follow
      his final book precisely. Fowler's code is in Java, Ruby, C\#,
      etc. I updated the Scala programs in 2018 to make sure they would
      compile and execute under the current Scala release.
    \end{itemize}
  \item
    Graphviz and \texttt{dot} language reference and examples

    \begin{itemize}
    \tightlist
    \item
      Note: On my iMacs, I used Homebrew to install the package
      \texttt{graphviz}.
    \item
      \href{http://www.graphviz.org}{Graphviz: Graph Visualization
      Software} and the little language/tool \texttt{dot}
    \item
      \href{Graphviz/ExprLangModDep.gv}{\texttt{ExprLangModDep.gv}} --
      \href{Graphviz/ExprLangModDep.sh}{\texttt{script}} --
      \href{Graphviz/ExprLangModDep.png}{\texttt{png} output}
    \item
      \href{Graphviz/DFA01.gv}{\texttt{DFA01.gv}} --
      \href{Graphviz/DFA01.sh}{script} --
      \href{Graphviz/DFA01.pdf}{\texttt{pdf} output}
    \item
      \href{Graphviz/NFA01.gv}{\texttt{NFA01.gv}} --
      \href{Graphviz/NFA01.sh}{script} --
      \href{Graphviz/NFA01.svg}{\texttt{svg} output}
    \item
      \href{Graphviz/NFA01a.gv}{\texttt{NFA01a.gv}} --
      \href{Graphviz/NFA01a.sh}{script} --
      \href{Graphviz/NFA01a.svg}{\texttt{svg} output}
    \item
      \href{Graphviz/Infix1plus1b.gv}{\texttt{Infix1plus1b.gv}} --
      \href{Graphviz/Infix1plus1b.sh}{script} --
      \href{Graphviz/Infix1plus1b.png}{\texttt{png} output}
    \end{itemize}
  \item
    Scala State Machine Semantic Model (Fowler Ch. 1, 3, 11)

    \begin{itemize}
    \tightlist
    \item
      \href{StateMachineDSL/Scala/StateMachine.scala}{StateMachine.scala}
    \item
      \href{StateMachineDSL/Scala/StateMachineTest.scala}{StateMachineTest.scala}
    \item
      \href{StateMachineDSL/Scala/CommandChannel.scala}{CommandChannel.scala
      (mock)}
    \item
      \href{StateMachineDSL/Scala/StateMachineDirect.sh}{StateMachineDirect.sh
      test script}
    \end{itemize}
  \item
    Scala XML-based External DSL (Fowler Ch. 1, 3, 5)

    \begin{itemize}
    \tightlist
    \item
      \href{StateMachineDSL/Scala/StateMachineXMLTest.scala}{StateMachineXMLTest
      .scala}
    \item
      \href{StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala}{IncrementalStateMachineBuilder.scala}
    \item
      \href{StateMachineDSL/Scala/SecretPanel.xml}{input file
      SecretPanel.xml}
    \item
      \href{StateMachineDSL/Scala/StateMachineXML.sh}{StateMachineXML.sh
      test script}
    \end{itemize}
  \item
    Scala Custom External DSL with a Delimiter-Directed parser (Fowler
    Ch. 1, 3, 5, 17)

    \begin{itemize}
    \tightlist
    \item
      \href{StateMachineDSL/Scala/DelimiterDSLTest.scala}{DelimiterDSLTest.scala}
    \item
      \href{StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala}{IncrementalStateMachineBuilder.scala}
    \item
      \href{StateMachineDSL/Scala/CustomExternalStateMachineDSL.dsl}{input
      file CustomExternalStateMachineDSL.dsl}
    \item
      \href{StateMachineDSL/Scala/DelimiterDSL.sh}{DelimiterDSL.sh test
      script}
    \end{itemize}
  \item
    Scala Custom External DSL with hand-coded Ad Hoc Recursive-Descent
    parser (Fowler Ch. 1, 3, 5, 21)

    \begin{itemize}
    \tightlist
    \item
      \href{StateMachineDSL/Scala/RecursiveDescentTest.scala}{RecursiveDescentTest.scala}
    \item
      \href{StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala}{IncrementalStateMachineBuilder.scala}
    \item
      \href{StateMachineDSL/Scala/CustomExternalStateMachineDSL2.dsl}{input
      file CustomExternalStateMachineDSL2.dsl}
    \item
      \href{StateMachineDSL/Scala/RecursiveDescent.sh}{RecursiveDescent.sh
      test script}
    \end{itemize}
  \item
    Scala Custom External DSL (using Scala parser combinator library)
    with embedded state machine builder (Fowler Ch. 1, 3, 5, 22)

    \begin{itemize}
    \tightlist
    \item
      \href{StateMachineDSL/Scala/CombinatorParserBuilderTest.scala}{CombinatorParserBuilderTest.scala}
    \item
      \href{StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala}{IncrementalStateMachineBuilder.scala}
    \item
      \href{StateMachineDSL/Scala/CustomExternalStateMachineDSL2.dsl}{input
      file CustomExternalStateMachineDSL2.dsl}
    \item
      \href{StateMachineDSL/Scala/CombinatorParserBuilder.sh}{CombinatorParserBuilder.sh
      test script}
    \end{itemize}
  \item
    Scala Custom External DSL (using Scala parser combinator library)
    with full AST construction (Fowler Ch. 1, 3, 5, 22)

    \begin{itemize}
    \tightlist
    \item
      \href{StateMachineDSL/Scala/CombinatorParserASTTest.scala}{CombinatorParserASTTest.scala}
    \item
      \href{StateMachineDSL/Scala/CustomExternalStateMachineDSL2.dsl}{input
      file CustomExternalStateMachineDSL2.dsl}
    \item
      \href{StateMachineDSL/Scala/CombinatorParserAST.sh}{CombinatorParserAST.sh
      test script}
    \end{itemize}
  \item
    Scala Static C Code Generator with Model-Aware target platform
    library (Fowler Ch. 1, 3, 5, 8, 52, 55)

    \begin{itemize}
    \tightlist
    \item
      \href{StateMachineDSL/Scala/StaticC_GeneratorTest.scala}{StaticC\_GeneratorTest.scala}
    \item
      \href{StateMachineDSL/Scala/StaticC_Generator.sh}{StaticC\_Generator.sh
      test script}
    \item
      \href{StateMachineDSL/Scala/output.c}{generated C output file
      output.c}
    \item
      Note: The needed framework code needed to run the generated C
      program is not yet available in this form. It needs to be
      reconstructed from Fowler's book.
    \end{itemize}
  \item
    Scala Graphviz Dot Language Code Generator (added 2018) (Fowler Ch.
    1, 3, 5, 8, 52)

    \begin{itemize}
    \tightlist
    \item
      \href{StateMachineDSL/Scala/GraphVizCodeGen.scala}{GraphVizCodeGen.scala}
    \item
      \href{StateMachineDSL/Scala/GraphVizCodeGenTest.scala}{GraphVizCodeGenTest.scala}
    \item
      \href{StateMachineDSL/Scala/GraphVizCodeGen.sh}{GraphVizCodeGen.sh
      test script}
    \item
      \href{StateMachineDSL/Scala/graph.gv}{generated Graphviz Dot
      output file graph.gv} (see test script)
    \item
      \href{StateMachineDSL/Scala/graph.svg}{Scalable Vector Graphics
      output from dot graph.svg} (see test script)
    \item
      \href{StateMachineDSL/Scala/graph.pdf}{PDF output from dot
      graph.pdf} (see test script)
    \end{itemize}
  \end{enumerate}
\item
  (TBD) Discuss Fowler's Computer Configuration Internal (Ch. 4, 35, 36,
  38)

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background: Martin Fowler. \emph{Domain Specific Languages},
    (Addison Wesley, 2011).

    \begin{itemize}
    \tightlist
    \item
      Martin Fowler's \href{http://martinfowler.com/dslCatalog/}{List of
      DSL Patterns} from \emph{Domain Specific Languages}, Addison
      Wesley, 2011
    \item
      Fowler DSL Chapter 1
      ``\href{http://www.informit.com/articles/article.aspx?p=1592379}{An
      Introductory Example}''
    \item
      Fowler DSL Chapter 2 ``Using Domain-Specific Languages''
    \item
      Fowler DSL Chapter 3 ``Implementing DSLs''
    \item
      Fowler DSL Chapter 4 ``Implementing an Internal DSL''
    \item
      Fowler DSL Chapter 11 ``Semantic Model''
    \item
      Fowler DSL Chapter 13 ``Context Variable''
    \item
      Fowler DSL Chapter 32 ``Expression Builder''
    \item
      Fowler DSL Chapter 33 ``Function Sequence''
    \item
      Fowler DSL Chapter 34 ``Nested Functions''
    \item
      Fowler DSL Chapter 35 ``Method Chaining''
    \item
      Fowler DSL Chapter 36 ``Object Scoping''
    \item
      Fowler DSL Chapter 37 ``Closure''
    \item
      Fowler DSL Chapter 38 ``Nested Closure''
    \item
      Fowler DSL Chapter 39 ``Literal List''
    \item
      Fowler DSL Chapter 40 ``Literal Map''
    \end{itemize}
  \item
    Scala versions (2009)

    \begin{itemize}
    \tightlist
    \item
      \href{CompConfigDSL/Scala/Computer.scala}{Scala semantic model
      (shared)}
    \item
      \href{CompConfigDSL/Scala/CompConfigChaining.scala}{Scala internal
      DSL using Method Chaining}
    \item
      \href{CompConfigDSL/Scala/CompConfigClosure.scala}{Scala internal
      DSL using Nested Closures and Object Scoping}
    \item
      \href{CompConfigDSL/Scala/CompConfig.sh}{CompConfig.sh test
      script}
    \end{itemize}
  \end{enumerate}
\item
  (TBD) Discuss Fowler's Email Message Building Internal DSL (Ch. 35)

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background: Martin Fowler. \emph{Domain Specific Languages},
    (Addison Wesley, 2011). See listing of chapters under Computer
    Configuration internal DSL above.
  \item
    Scala versions (2009)

    \begin{itemize}
    \tightlist
    \item
      \href{EmailDSL/Scala/EmailProgressive.scala}{Scala internal DSL
      using Method Chaining and Progressive Interfaces}
    \item
      \href{EmailDSL/Scala/EmailProgressive.sh}{test script
      \texttt{EmailProgressive.sh}}
    \end{itemize}
  \end{enumerate}
\item
  Explore Fowler's Lair Configuration DSLs

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background on Lair DSL

    \begin{itemize}
    \tightlist
    \item
      Case study: Martin Fowler's
      \href{http://media.pragprog.com/titles/twa/martin_fowler.pdf}{One
      Lair and Twenty Ruby DSLs}, Chapter 3,
      \href{http://pragprog.com/book/twa/thoughtworks-anthology}{\emph{The
      ThoughtWorks Anthology: Essays on Software Technology and
      Innovation}}, The Pragmatic Bookshelf, 2008 --
      \href{LairDSL/FowlerOneLairTwentyDSLs.pdf}{local copy}
    \item
      Source code:
      \href{https://pragprog.com/titles/twa/source_code}{entire
      Thoughtworks book}{]} {[}\href{LairDSL/Ruby}{Fowler's Ruby DSLs}
    \item
      Patterns (repeated from above): Martin Fowler's
      \href{http://martinfowler.com/dslCatalog/}{List of DSL Patterns}
      from \emph{Domain Specific Languages}, Addison Wesley, 2011
    \end{itemize}
  \item
    Background on internal DSLs: Martin Fowler. \emph{Domain Specific
    Languages}, (Addison Wesley, 2011).

    See the CSci 658 (Software Language Engineering) course materials
    for more information about DSLs.
  \item
    Background on Lua

    \begin{itemize}
    \item
      See \protect\hyperlink{lua}{Lua references} below
    \item
      Several of the Lair DSL programs must execute with Lua 5.1 because
      they use a few Lua platform features changed in Lua 5.2 or 5.3. I
      installed the lua@5.1 package on my iMacs using the Homebrew
      package manager.
    \item
      At the terminal command line, \texttt{lua5.1\ testNN.lua} compiles
      and executes the test driver program for the DSL with files
      builder program \texttt{builderNN.lua} and DSL script
      \texttt{rulesNN.lua}.
    \end{itemize}
  \item
    Shared modules

    Fowler's Ruby source

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Ruby/model.rb}{Semantic model (model.rb)}
    \item
      \href{LairDSL/Ruby/rules0.rb}{Test Driver for semantic model
      (rules0.rb)}
    \end{itemize}

    Lua (2013)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Lua/class_support.lua}{Class support module (for
      implementing classes in Lua)}
    \item
      \href{LairDSL/Lua/model.lua}{Semantic model}
    \item
      \href{LairDSL/Lua/rules00.lua}{Test driver for semantic model
      (rules00.lua)}
    \end{itemize}

    Python 3 (2018)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Python/model.py}{Semantic model}
    \item
      \href{LairDSL/Python/rules00.py}{Test driver for semantic model
      (rules00.py)}
    \end{itemize}
  \item
    Internal DSL using Global Function Sequence pattern

    Fowler's Ruby

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Ruby/builder8.rb}{builder module (builder8.rb)}
    \item
      \href{LairDSL/Ruby/rules8.rb}{dsl script (rules8.rb)}
    \end{itemize}

    Lua (2013)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Lua/builder08.lua}{builder module (builder08.lua)}
    \item
      \href{LairDSL/Lua/rules08.lua}{dsl script (rules08.lua)}
    \item
      \href{LairDSL/Lua/test08.lua}{test driver (test08.lua)}
    \end{itemize}

    Python 3 (2018)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Python/builder08.py}{builder module (builder08.py)}
    \item
      \href{LairDSL/Python/rules08x.py}{direct execution test of DSL
      script (rules08x.py)}
    \item
      \href{LairDSL/Python/rules08.py}{dynamically loaded dsl script
      (rules08.py)}
    \item
      \href{LairDSL/Python/test08.py}{test driver for dynamically loaded
      dsl script (test08.py)}
    \end{itemize}
  \item
    Internal DSL using Class Method Function Sequence and Method
    Chaining patterns

    Fowler's Ruby

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Ruby/builder11.rb}{builder module (builder11.rb)}
    \item
      \href{LairDSL/Ruby/rules11.rb}{dsl script (rules11.rb)}
    \end{itemize}

    Lua (2013)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Lua/builder11.lua}{builder module (builder11.lua)}
    \item
      \href{LairDSL/Lua/rules11.lua}{dsl script (rules11.lua)}
    \item
      \href{LairDSL/Lua/test11.lua}{test driver (test11.lua)}
    \end{itemize}

    Python 3 (2018)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Python/builder11.py}{builder module (builder11.py)}
    \item
      \href{LairDSL/Python/rules11.py}{dynamically loaded dsl script
      (rules11.py)}
    \item
      \href{LairDSL/Python/test11.py}{test driver for dynamically loaded
      dsl script (test11.py)}
    \end{itemize}
  \item
    Internal DSL using Expression Builder and Method Chaining patterns

    Fowler's Ruby

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Ruby/builder14.rb}{builder module (builder14.rb)}
    \item
      \href{LairDSL/Ruby/rules14.rb}{dsl script (rules14.rb)}
    \end{itemize}

    Lua (2013)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Lua/builder14.lua}{builder module (builder14.lua)}
    \item
      \href{LairDSL/Lua/rules14.lua}{dsl script (rules14.lua)}
    \item
      \href{LairDSL/Lua/test14.lua}{test driver (test14.lua)}
    \end{itemize}

    Python 3 (2018)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Python/builder14.py}{builder module (builder14.py)}
    \item
      \href{LairDSL/Python/rules14.py}{dynamically loaded dsl script
      (rules14.py)}
    \item
      \href{LairDSL/Python/test14.py}{test driver for dynamically loaded
      dsl script (test14.py)}
    \end{itemize}
  \item
    Internal DSL using Nested Closures pattern

    Fowler's Ruby

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Ruby/builder3.rb}{builder module (builder3.rb)}
    \item
      \href{LairDSL/Ruby/rules3.rb}{dsl script (rules3.rb)}
    \end{itemize}

    Lua (2013)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Lua/builder03.lua}{builder module (builder03.lua)}
    \item
      \href{LairDSL/Lua/rules03.lua}{dsl script (rules03.lua)}
    \item
      \href{LairDSL/Lua/test03.lua}{test driver (test03.lua)}
    \end{itemize}

    Python 3 -- none yet. (Python's weak syntactic support for lambdas
    does not allow the relatively direct approach usable in Ruby, Scala,
    and Lua.)
  \item
    Internal DSL using Expression Builder, Object Scoping, and Method
    Chaining patterns

    Fowler's Ruby

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Ruby/builder17.rb}{builder module (builder17.4b)}
    \item
      \href{LairDSL/Ruby/rules17.rb}{dsl script (rules17.rb)}
    \end{itemize}

    Lua (2013)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Lua/builder17.lua}{builder module (builder17.lua)}
    \item
      \href{LairDSL/Lua/rules17.lua}{dsl script (rules17.lua)}
    \item
      \href{LairDSL/Lua/test17.lua}{test driver (test17.lua)}
    \end{itemize}

    Python 3 -- none yet
  \item
    Internal DSL using Literal Collection pattern

    Fowler's Ruby

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Ruby/builder22.rb}{builder module (builder22.rb)}
    \item
      \href{LairDSL/Ruby/rules22.rb}{dsl script (rules22.rb)}
    \end{itemize}

    Lua (2013)

    \begin{itemize}
    \tightlist
    \item
      \href{LairDSL/Lua/builder22.lua}{builder module (builder22.lua)}
    \item
      \href{LairDSL/Lua/rules22.lua}{dsl script (rules22.lua)}
    \item
      \href{LairDSL/Lua/test22.lua}{test driver (test22.lua)}
    \end{itemize}

    Python 3 -- none yet
  \item
    External DSL using Parser/Builder (no corresponding example in
    Fowler book chapter)

    Lua (2013)

    \begin{itemize}
    \tightlist
    \item
      Note: This program requires installation of a Lua LPEG library via
      luarocks. It must be compatible with whatever version of Lua is
      being used.
    \item
      \href{LairDSL/Lua/builderLPEG1.lua}{builder module
      (builderLPEG1.lua)}
    \item
      \href{LairDSL/Lua/rulesLPEG1.dsl}{dsl script (rulesLPEG1.dsl)}
    \item
      \href{LairDSL/Lua/testLPEG1.lua}{test driver (testLPEG1.lua)}
    \end{itemize}

    Python 3 (2018)

    \begin{itemize}
    \tightlist
    \item
      Note: This program requires installation of the Python 3 package
      \href{https://github.com/johnthagen/parsita}{Parsita}, a parser
      combinator library similar to Scala's
    \item
      \href{LairDSL/Python/builderParsita1.py}{builder module
      (builderParsita1.py)}
    \item
      \href{LairDSL/Python/rulesParsita1.dsl}{dsl script
      (rulesParsita1.dsl)}
    \item
      \href{LairDSL/Python/testParsita1.py}{test driver
      (testParsita1.py)}
    \end{itemize}
  \end{enumerate}
\item
  (TBD) Discuss Fowler's DSL Reader framework (2006)

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Background:

    \begin{itemize}
    \tightlist
    \item
      Martin Fowler.
      \href{http://www.martinfowler.com/articles/languageWorkbench.html}{Language
      Workbenches: The Killer-App for Domain Specific Languages?} June
      2005.
    \item
      Martin Fowler.
      \href{http://www.martinfowler.com/articles/codeGenDsl.html}{Generating
      Code for DSLs}, June 2005.
    \end{itemize}
  \item
    Ruby shared modules (2006)

    \begin{itemize}
    \tightlist
    \item
      \href{ReaderDSL/Ruby/ReaderFramework.rb}{DSL Reader Framework
      module (ReaderFramework.rb)}
    \item
      \href{ReaderDSL/Ruby/ReaderUtilities.rb}{DSL Reader Utilities
      mix-in module (ReaderUtilities.rb)}
    \item
      \href{ReaderDSL/Ruby/fowlerdata.txt}{Data input file
      (fowlerdata.txt)}
    \item
      \href{ReaderDSL/Ruby/dslinput.txt}{Text DSL description
      (dslinput.txt)}
    \item
      \href{ReaderDSL/Ruby/dslinput.xml}{XML DSL description
      (dslinput.xml)}
    \end{itemize}
  \item
    Ruby direct configuration and testing of Reader (2006)

    \begin{itemize}
    \tightlist
    \item
      \href{ReaderDSL/Ruby/BuilderDirect.rb}{BuilderDirect.rb}
    \end{itemize}
  \item
    Ruby single-pass external text DSL (2006)

    \begin{itemize}
    \tightlist
    \item
      \href{ReaderDSL/Ruby/TextSinglePass.rb}{TextSinglePass.rb}
    \end{itemize}
  \item
    Ruby two-pass external XML DSL (2006)

    \begin{itemize}
    \tightlist
    \item
      \href{ReaderDSL/Ruby/TwoPass.rb}{TwoPass.rb}
    \item
      \href{ReaderDSL/Ruby/GeneratedBuilderExternal.rb}{class
      BuilderExternal source code generated by TwoPass.rb}
    \end{itemize}
  \item
    Ruby internal DSL

    \begin{itemize}
    \tightlist
    \item
      \href{ReaderDSL/Ruby/RubyDSL.rb}{RubyDSL.rb}
    \end{itemize}
  \end{enumerate}
\item
  H.C. Cunningham. ``A Little Language for Surveys: Constructing an
  Internal DSL in Ruby,'' In \emph{Proceedings of the ACM SouthEast
  Conference}, 6 pages, March 2008.

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    \href{http://www.cs.olemiss.edu/~hcc/papers/surveyLangFinal.pdf}{manuscript}
  \item
    \href{http://www.cs.olemiss.edu/~hcc/papers/surveyLanguage4.ppt}{presentation}
  \item
    \href{SurveyDSL/SurveyLanguage_rb.txt}{Ruby source}
  \item
    \href{SurveyDSL/survey_rb.txt}{test DSL input file}
  \item
    \href{SurveyDSL/surveyErrors_rb.txt}{test DSL input file with
    errors}
  \end{enumerate}
\end{enumerate}

\hypertarget{object-oriented-programming-and-frameworks}{%
\subsubsection{Object-Oriented Programming and
Frameworks}\label{object-oriented-programming-and-frameworks}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{50}
\item
  (for reference) Simple, silly Employee hierarchy example

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    \href{Employee/Scala/EmployeeTest.scala}{Scala (2008, 2010)}
  \item
    \href{Employee/Ruby/employee.rb}{Ruby (2006)}
  \end{enumerate}
\item
  (TBD) Overview object-oriented programming in Scala

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Instructor's notes on \href{OOSoftDev.html}{Object-Oriented Software
    Development}
  \item
    Scala translation of Frog dynamic composition example: ~
    \href{Frog/Scala/FrogTest.scala}{Scala source} --
    \href{Frog/Scala/FrogTest.out}{output}
  \item
    Modified Philosophical Frog example from Odersky et al:\\
    \href{PhilFrog/Scala/PhilFrog.scala}{Scala source} --
    \href{PhilFrog/Scala/PhilFrog.out}{output}
  \item
    Modified Stackable traits example (IntQueue) from Odersky et al:\\
    \href{Stackable/Scala/StackableTest.scala}{Scala source} --
    \href{Stackable/Scala/StackableTest.out}{output}
  \end{enumerate}
\item
  (TBD) Frameworks, based on Timothy Budd's An Introduction to
  Object-Oriented Programming, Third Edition, Chapter 21

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Simple Sorting Framework examples.

    \begin{itemize}
    \tightlist
    \item
      Low-level concrete Employee sorting:
      \href{SortFramework/Scala/SortEmployee.scala}{Scala source}
    \item
      Insertion Sorting framework:
      \href{SortFramework/Scala/InsertionSorter.scala}{Scala source}
    \item
      Employee Sorting application of framework:
      \href{SortFramework/Scala/EmployeeSorter.scala}{Scala source}
    \item
      Test code for Employee Sorting application of framework:
      \href{SortFramework/Scala/TestEmployeeSorter.scala}{Scala source}
    \end{itemize}
  \item
    Ice Cream Store discrete event simulation.

    \begin{itemize}
    \tightlist
    \item
      Simulation framework:
      \href{IceCreamStore/Scala/SimFramework.scala}{Scala source}
    \item
      Ice Cream Store application:
      \href{IceCreamStore/Scala/IceCreamStoreApp.scala}{Scala source}
      \href{IceCreamStore/Scala/IceCreamStoreSim.out}{typical output}
    \end{itemize}
  \end{enumerate}
\item
  (TBD) Cunningham group ``Using Classic Problems \ldots{}'' paper.

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    H. C. Cunningham, Y. Liu, and C. Zhang. ``Using Classic Problems to
    Teach Java Framework Design,'' \emph{Science of Computer
    Programming}, Special Issue on Principles and Practice of
    Programming in Java (PPPJ 2004), Vol. 59, No.~1-2, pp.~147-169,
    January 2006. doi: 10.10.16/j.scico.2005.07.009.
    \href{/~hcc/papers/classicProblems.pdf}{preprint PDF}
  \item
    Related tutorial: H. C. Cunningham, Y. Liu, and C. Zhang. ``Teaching
    Framework Design Using Classic Problems,'' \emph{Journal of
    Computing Sciences in Colleges}, Vol. 21, No.~5, pp.~10-12, CCSC,
    May 2006:
    \href{/~hcc/papers/FrameworkDesignTutorialFinal.pdf}{abstract}
    \href{/~hcc/papers/FrameworkDesignTutorial3e.ppt}{presentation}
  \end{enumerate}
\item
  (TBD) Scala Divide-and-Conquer Framework, similar to the Java
  framework in the ``Using Classic Problems \ldots{}'' paper

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Template-based Divide-and-Conquer Framework (DivConqTemplate):\\
    \href{DivConq/Scala/DivConqTemplate.scala}{Scala source}
  \item
    Strategy-based Divide-and-Conquer Framework (DivConqStrategy):\\
    \href{DivConq/Scala/DivConqStrategy.scala}{Scala source}
  \item
    Traits for Problem and Solution descriptions for both frameworks
    (DivConqProblemSolution):\\
    \href{DivConq/Scala/DivConqProblemSolution.scala}{Scala source}
  \item
    Application of Template-based framework to QuickSort
    (QuickSortTemplateApp):\\
    \href{DivConq/Scala/QuickSortTemplateApp.scala}{Scala source} --
    \href{DivConq/Scala/QuickSortTemplateApp.out}{program output}
  \item
    Application of Strategy-based framework to QuickSort
    (QuickSortStrategyApp):\\
    \href{DivConq/Scala/QuickSortStrategyApp.scala}{Scala source} --
    \href{DivConq/Scala/QuickSortStrategyApp.out}{program output}
  \item
    Descriptor for QuickSort state for both QuickSort applications
    (QuickSortDesc):\\
    \href{DivConq/Scala/QuickSortDesc.scala}{Scala source}
  \end{enumerate}
\item
  (TBD) Scala Binary Tree Framework, similar to the Java framework in
  the ``Using Classic Problems \ldots{}'' paper

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \item
    Straightforward translation of the Java program to Scala:

    \begin{itemize}
    \tightlist
    \item
      Top-level framework (BinTreeFramework):
      \href{BinTree/Scala/Nongeneric/BinTreeFramework.scala}{Scala
      source}
    \item
      Second-level Euler tour framework (EulerTourVisitor):
      \href{BinTree/Scala/Nongeneric/EulerTourVisitor.scala}{Scala
      source}
    \item
      Second-level mapping framework (MappingVisitor):
      \href{BinTree/Scala/Nongeneric/MappingVisitor.scala}{Scala source}
    \item
      Second-level breadth-first framework (BreadthFirstVisitor):
      \href{BinTree/Scala/Nongeneric/BreadthFirstVisitor.scala}{Scala
      source}
    \item
      Application of BinTree frameworks (BinTreeTest):
      \href{BinTree/Scala/Nongeneric/BinTreeTest.scala}{Scala source}
    \end{itemize}
  \item
    Generic implementation of BinTree framework in Scala:

    \begin{itemize}
    \tightlist
    \item
      Top-level framework (BinTreeFramework):
      \href{BinTree/Scala/Generic/BinTreeFramework.scala}{Scala source}
    \item
      Second-level Euler tour framework (EulerTourVisitor)
      \href{BinTree/Scala/Generic/EulerTourVisitor.scala}{Scala source}
    \item
      Second-level mapping framework (MappingVisitor):
      \href{BinTree/Scala/Generic/MappingVisitor.scala}{Scala source}
    \item
      Second-level breadth-first framework (BreadthFirstVisitor):
      \href{BinTree/Scala/Generic/BreadthFirstVisitor.scala}{Scala
      source}
    \item
      Application of BinTree frameworks (BinTreeTest):
      \href{BinTree/Scala/Generic/BinTreeTest.scala}{Scala source}
    \end{itemize}
  \end{enumerate}
\end{enumerate}

\hypertarget{programming-language-reference-materials}{%
\subsection{Programming Language Reference
Materials}\label{programming-language-reference-materials}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{56}
\tightlist
\item
  \href{Free_Prog_Lang_Textbooks.html}{Free online programming language
  textbooks and tutorials}
\end{enumerate}

\hypertarget{haskell}{%
\subsubsection{Haskell}\label{haskell}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{57}
\item
  \href{https://learnxinyminutes.com/docs/haskell/}{Learn X in Y
  Minutes, Where X = Haskell}
\item
  H. Conrad Cunningham.
  \href{https://john.cs.olemiss.edu/~hcc/csci450/notes/HaskellNotes/IntroFP_Haskell.html}{Introduction
  to Functional Programming Using Haskell}, Computer and Information
  Science, University of Mississippi, 2016-2017. (I am writing this
  ``textbook'' primarily for CSci 450 and likely will use the title
  \emph{Exploring Languages with Interpreters and Functional
  Programming} for the Fall 2018 draft.)
\item
  H. Conrad Cunningham. \href{haskell_notes.pdf}{\emph{Notes on
  Functional Programming with Haskell}}, Computer and Information
  Science, University of Mississippi, 1994-2014. (I am revising this
  document and integrating it with other materials to produce the new
  ``textbook'' above \emph{Exploring Languages with Interpreters and
  Functional Programming}. The chapters at the chapters at the end have
  not yet been integrated.)
\item
  \href{http://www.haskell.org}{Haskell language website}

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \tightlist
  \item
    \href{http://www.haskell.org/onlinereport/haskell2010/}{\emph{Haskell
    2010 Language Report}}
  \item
    \href{http://www.haskell.org/ghc/docs/latest/html/users_guide/}{\emph{GHC
    User's Guide}}
  \end{enumerate}
\item
  \href{http://cheatsheet.codeslower.com/CheatSheet.pdf}{\emph{Haskell
  Cheat Sheet}}
\item
  \href{https://www.fpcomplete.com/school}{School of Haskell} online
  tutorials
\item
  Miron Lipovaca. \href{http://learnyouahaskell.com/}{\emph{Learn You a
  Haskell for Great Good: A Beginner's Guide}}, a free online tutorial
  at \url{http://learnyouahaskell.com/}. (It is also in print from No
  Starch Press, 2011.)
\item
  Kees Doets and Jan van Eijck.
  \href{http://fldit-www.cs.uni-dortmund.de/~peter/PS07/HR.pdf}{\emph{The
  Haskell Road to Logic, Math and Programming}}, March 2004. This book
  is also available in print, published by College Publications, 2004.
\item
  Paul Hudak.
  \href{https://www.google.com/url?sa=t\&rct=j\&q=\&esrc=s\&source=web\&cd=2\&ved=0ahUKEwjsveil57TZAhUCyVMKHdv3DG4QFggvMAE\&url=http\%3A\%2F\%2Fwww.cs.yale.edu\%2Fhomes\%2Fhudak\%2FPapers\%2FHSoM.pdf\&usg=AOvVaw0ito3odDctDREQ7Yw3QTsR}{\emph{The
  Haskell School of Music: From Signals to Symphonies}}, Version 2.6,
  January 2014. This book is a recent rewrite of Hudak's \emph{The
  Haskell School of Expression: Learning Functional Programming through
  Multimedia}, Cambridge University Press, 2000.
\item
  Simon Marlowe.
  \href{https://web.archive.org/web/20180117182938/http://chimera.labs.oreilly.com/books/1230000000929/index.html}{\emph{Parallel
  and Concurrent Programming in Haskell: Techniques for Multicore and
  Multithreaded Programming}},

  \begin{enumerate}
  \def\labelenumii{\arabic{enumii}.}
  \setcounter{enumii}{2012}
  \tightlist
  \item
    This book is also available in print, published by O'Reilly Media,
    2013.
  \end{enumerate}
\item
  Bryan O'Sullivan, Don Stewart, and John Goerzen.
  \href{http://book.realworldhaskell.org}{\emph{Real World Haskell}},

  \begin{enumerate}
  \def\labelenumii{\arabic{enumii}.}
  \setcounter{enumii}{2007}
  \tightlist
  \item
    This book is also available in print, published by O'Reilly Media in
    November 2008.
  \end{enumerate}
\end{enumerate}

\hypertarget{lua}{%
\subsubsection{Lua}\label{lua}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{68}
\item
  \href{https://learnxinyminutes.com/docs/lua/}{Learn X in Y Minutes,
  Where X = Lua}
\item
  Definitive reference: Roberto Ierusalimshcy. \emph{Programming in
  Lua}, Fourth Edition, Lua.org, Rio de Janiero, Brazil, 2016. (The
  \href{https://www.lua.org/pil/contents.html}{First Edition} of this
  book, covering Lua 5.0, is available online at
  \url{https://www.lua.org/pil/contents.html}.)
\item
  Instructor's Lua slides (from CSci 450, Fall 2016)

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \tightlist
  \item
    Background: The slides below are adapted, in part, from
    \href{http://www.dcc.ufrj.br/~fabiom/lua/}{\emph{Programming in Lua,
    Slides for Course}} by Fabio Mascarenhas from the Federal University
    of Rio de Janeiro, Brazil. He taught a course, which used Lua 5.2,
    at Nankai University, P. R. China, in July 2013.
  \item
    \href{LuaIntro/01IntroLua.html}{Introduction to Lua} HTML slides
    based, in part, on Mascarenhas slide sets 0-5
  \item
    \href{LuaIntro/02IntroLua.html}{Advanced Lua Functions} HTML slides
    based, in part, on Mascarenhas slide set 6
  \item
    \href{LuaIntro/03IntroLua.html}{Modules in Lua} HTML slides based,
    in part, on Mascarenhas slide set 9
  \item
    \href{LuaIntro/04IntroLua.html}{Lua Metatables} HTML slides based,
    in part, on Mascarenhas slide set 10
  \item
    \href{LuaIntro/05IntroLua.html}{Lua Objects} HTML slides based, in
    part, on Mascarenhas slide set 11
  \end{enumerate}
\end{enumerate}

\hypertarget{python-3}{%
\subsubsection{Python 3}\label{python-3}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{71}
\item
  \href{https://learnxinyminutes.com/docs/python3/}{Learn X in Y
  Minutes, Where X = Python3}
\item
  Bernd Klein. \href{https://www.python-course.eu}{Python Course}
\end{enumerate}

\hypertarget{ruby}{%
\subsubsection{Ruby}\label{ruby}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{73}
\item
  \href{https://learnxinyminutes.com/docs/ruby/}{Learn X in Y Minutes,
  Where X = Ruby}
\item
  Chris Pine. \href{http://pine.fm/LearnToProgram/}{Learn to Program}
\item
  why the lucky stiff (Jonathan Gillette).
  \href{http://mislav.uniqpath.com/poignant-guide/}{why's (poignant)
  guide to Ruby}
\end{enumerate}

\hypertarget{scala}{%
\subsubsection{Scala}\label{scala}}

\begin{enumerate}
\def\labelenumi{\arabic{enumi}.}
\setcounter{enumi}{76}
\item
  \href{https://learnxinyminutes.com/docs/scala/}{Learn X in Y Minutes,
  Where X = Scala}
\item
  Definitive reference: Martin Odersky, Lex Spoon, and Bill Venners.
  \emph{Programming in Scala}, Third Edition, Artima, 2016. The first
  edition (2008) is available online at
  \url{http://www.artima.com/pins1ed/}.
\item
  Martin Odersky.
  \href{http://www.scala-lang.org/docu/files/ScalaByExample.pdf}{\emph{Scala
  by Example}}, EPFL, 2014.
  {[}\href{localcopy/ScalaByExample.pdf}{local}{]}
\item
  Instructor's \href{ScalaForJava/ScalaForJava.html}{Notes on Scala for
  Java Programmers}
\item
  Paul Chiusano and Runar Bjarnason. \emph{Functional Programming in
  Scala}, Manning, 2015.

  \begin{enumerate}
  \def\labelenumii{\alph{enumii}.}
  \tightlist
  \item
    Instructor's Notes on \href{FPS03/FunctionalDS.html}{Functional Data
    Structures (Chapter 3)}
  \item
    Instructor's Notes on \href{FPS04/ErrorHandling.html}{Error Handling
    without Exceptions (Chapter 4)}
  \item
    Instructor's Notes on \href{FPS05/Laziness.html}{Strictness and
    Laziness (Chapter 5)}
  \end{enumerate}
\end{enumerate}

\begin{center}\rule{0.5\linewidth}{0.5pt}\end{center}

Copyright (C) 2020, \href{http://www.cs.olemiss.edu/~hcc}{H. Conrad
Cunningham}\\
Format Updated 16 August 2020

\end{document}
