% CSci 658-01: Software Language Engineering \
  Spring 2018 Lecture Notes
% **H. Conrad Cunningham** 
% **4 May 2018**

| Copyright (C) 2018, 
  [H. Conrad Cunningham ](<http://www.cs.olemiss.edu/~hcc>)
| Professor of 
  [Computer and Information Science ](<https://www.cs.olemiss.edu>)
| [University of Mississippi ](<http://www.olemiss.edu>)
| 211 Weir Hall
| P.O. Box 1848
| University, MS 38677
| (662) 915-5358

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.

**Advisory**: The HTML version of this document requires use of a
browser that supports the display of MathML. A good choice as of
May 2018 is a recent version of Firefox from Mozilla.


# Lecture Notes

[**Go To Current Lecture**](<#current\_lecture>) 


## Lecture Notes, Examples, and Schedule


### Language-Oriented Programming

@.  **(22 Jan) Review syllabus.** 
    Distribute papers to be discussed over next two weeks.


@.  <a name="LittleLanguages"></a>
    **(24-26 Jan) Discuss "Little Languages" paper**

    a.  Paper: Jon Bentley. [Programming Pearls: Little Languages
	    ](<localcopy/BentleyLittleLanguages.pdf>),
	    *Communications of the ACM*, 
        Vol. 29, No. 8, pp. 711-721, August 1986. 

	#.  Software: The `groff` package includes the GNU implementations
        of the `troff` set of "Unix" tools such as `pic` and
        `chem`. (I installed this on my iMac using Homebrew. I also
        installed the `plotutils` package to help with display in
        various formats.)

	#.  Additional references for little language `pic` (not discussed)

   	    -   Brian W. Kernighan. 
		    [PIC \-- A Graphics Language for Typesetting, Revised User Manual 
		    ](<http://doc.cat-v.org/unix/v8/picmemo.pdf>), 
		    Computing Science Technical Report No. 116, 
		    Bell Laboratories, December 1984. 
		    \[[local](<localcopy/picmemo.pdf>)\]
        -   Philipp K. Janert. 
	        [In Praise of Pic 
		    ](<http://www.onlamp.com/pub/a/onlamp/2007/06/21/in-praise-of-pic.html>), 
		    *ONLamp.com*, O\'Reilly Media, June 2007, 
		    Retrieved 24 January, 2018. 
        -   Eric S. Raymond.
	        [Making Pictures with GNU PIC
		    ](<http://floppsie.comp.glam.ac.uk/Glamorgan/gaius/web/pic.html>),
		    August 1995.
        -   W. Richard Stevens.
		    [Examples of `pic` Macros ](<localcopy/pic\_examples.pdf>),
		    Retrieved from <http://www.kohala.com/start/>
		    (troff resources, pic), 24 January 2018.
		    \[[`pic` source](<localcopy/pic\_examples.txt>)\] 


    #.  Additional references for the little languages `lex`, `yacc`,
        `make`, and `chem` (not discussed)

        -   Jon L. Bentley, Lynn W. Jelinski, and Brian W. Kernighan.
	        [Chem -- A Program for Phototypesetting Chemical Structure
	        Diagrams ](<localcopy/chem.pdf>),
   		    AT&T Bell Laboratories, Murray Hill, NJ 07974, U.S.A.
        -   Stuart I. Feldman.
	        [Make -- A Program for Maintaining Computer Program 
	        ](<localcopy/make.pdf>), *Software: Practice and Experience*, 
		    Vol. 9, no. 4 pp. 255-265, 1979.
        -   Stephen C. Johnson. 
	        [Yacc: Yet Another Compiler-Compiler ](<localcopy/yacc.pdf>), 
		    Vol. 32. Murray Hill, NJ: Bell Laboratories, 1975.
        -   Michael E. Lesk and Eric Schmidt.
	        [Lex: A Lexical Analyzer Generator ](<localcopy/lex.pdf>),
		    Bell Laboratories Murray Hill, NJ, 1975.
        -   [Learn X in Y Minutes, Where X = make (GNU) 
            ](<https://learnxinyminutes.com/docs/make/>)
        -   [Learn X in Y Minutes, Where X = bash (GNU) 
            ](<https://learnxinyminutes.com/docs/bash/>)


@.  <a name="NoSilverBullet"></a>
    **(26-29 Jan) Discuss "No Silver Bullet" paper** and related issues

    a.  Paper: Frederick P. Brooks. 
	    [No Silver Bullet: Essence and Accident in Software Engineering 
	    ](<localcopy/NoSilverBullet.pdf>), 
	    *IEEE Computer*, Vol. 20, No. 4, 10-19, 1987. 

    #.  Retrospective paper after 10 years (not discussed): Frederick
	    P. Brooks. 'No Silver Bullet' Refired, Chapter 17 in *The
	    Mythical Man Month: Essays on Software Engineering,
	    Anniversary Edition*, Addison Wesley, 1995.


@.  <a name="LanguageOriented"></a>
    **(29-31 Jan) Discuss "Language-Oriented Programming" paper**

     a.  Paper: M. P. Ward. [Language-Oriented Programming
	     ](<http://www.cse.dmu.ac.uk/~mward/martin/papers/middle-out-t.pdf>), 
         *Software--Concepts and Tools,* Vol. 15, No. 4, pp. 147-161, 1994.
	     \[[local](<localcopy/LanguageOrientedProgramming.pdf>)\]

    #.  Additional references from paper (not discussed)
	
        -   Charles Antony Richard Hoare. 
	        [The Emperor's Old Clothes 
		    ](<localcopy/Hoare\_Turing\_Address.pdf>)
		    (1980 Turing Award Address), 
		    *Communications of the ACM*, Vol. 24, No. 2, 75-83, 1981.


@.  <a name="DSLIntro"></a> 
    **(31 Jan; intermittently until Spring Break, 19-28 Mar; 2-6 Apr) 
	Discuss overview of Domain Specific Languages**

    a.  Instructor's notes on 
	    [Domain Specific Languages ](<DomainSpecificLanguages.html>)

    b.  Mixed-in introductory discussion of 
	    [Fowler's DSL book introductory chapters ](<#FowlerDSLintro>), 
	    [State Machine DSL ](<#StateMachineDSL>), and
		[Computer Configuration DSL ](<#CompConfigDSL>) below.

    c.  References used in notes (most not discussed directly)
	
        -   Martin Fowler. Using Domain-Specific Languages, Chapter 2, 
	        *Domain-Specific Languages*, Addison Wesley, 2011. 
        -   Steve Freeman and Nat Pryce.
            [Evolving an Embedded Domain-Specific Language in Java
	        ](<http://www.jmock.org/oopsla2006.pdf>), 
    	    In *Proceedings of the ACM SIGPLAN International Conference 
	        on Object-Oriented Programming, Systems, Languages, and 
	        Applications (OOPSLA)*, 12 pages, 2006.
	        \[[local](<localcopy/EvolvingEmbeddedDSLJava.pdf>)\]
        -   Gabor Karsai, Holger Krahn, Claas Pinkernell, Bernhard Rumpe, 
            Martin Schindler and Steven Voelkel.
		    [Design Guidelines for Domain Specific Languages 
		    ](<https://arxiv.org/pdf/1409.2378>), 
	        In *Proceedings of OOPSLA Workshop on Domain-Specific 
	        Modeling*, 2009. Also arXiv preprint arXiv:1409.2378, 2014. 
	        \[[local](<localcopy/Design\_Guidelines\_DSLs.pdf>)\]
        -   Marjan Mernik, Jan Heering, and Anthony M. Sloane. 
            [When and How to Develop Domain Specific Languages 
	        ](<https://pdfs.semanticscholar.org/bd06/01088d5f217dc136a898f577763df92891cb.pdf>), 
            *ACM Computing Surveys*, 37(4):316-344, December 2005. 
            \[[local](<localcopy/WhenDSL.pdf>)\]
         -  Scott A. Thibault, Renaud Marlet, and Charles Consel.
            [Domain-Specific Languages: From Design to Implementation--Application 
	        to Video Device Drivers Generation 
	        ](<localcopy/DSLDesignImpleVideo.pdf>). 
	        *IEEE Transactions on Software Engineering*, 25(3):363–377,
            May/June 1999.


@.  <a name="DesignPatterns"></a>
    **(dates on items) Survey Design Patterns**
	
    a.  **(5-7 Feb)** Instructor's notes on 
	    [Introduction to Patterns ](<Patterns/Patterns.html>) 
		\[[HTML slides](<Patterns/Intro\_Patterns.html>)\]

    #.  **(7 Feb)** Instructor's notes on 
	    [Pipes and Filters Architectural Pattern 
	    ](<Patterns/Pipes.html>)
	    (Not fully covered, used mainly to illustrate approach to
	    pattern definition)
	    \[[Powerpoint](<Patterns/sle\_Pipes\_Filters\_Pattern.ppt>)\]

    #.  **(9-12 Feb)** John Vlissides. Designing with Patterns, 
        In *Pattern Hatching: Design Patterns Applied*, 
	    Addison-Wesley, 1998. 
        \[[Powerpoint](<Patterns/sle\_Designing\_with\_Patterns.ppt>)\]
			
    #.  Additional references (not directly discussed in class)

	    -   [Source Making Design Patterns catalog
		    ](<https://sourcemaking.com/design_patterns>)
        -   Instructor's slides on
		    [Factory Method Design Pattern (Powerpoint) 
			](<Patterns/sle\_Factory\_Method\_Pattern.ppt>)
        -   Instructor's slides on
		    [Strategy Design Pattern (Powerpoint) 
		    ](<Patterns/sle\_Strategy\_Pattern.ppt>)
        -   Instructor's slides on 
		    [Template Method Design Pattern (Powerpoint) 
		    ](<Patterns/sle\_Template\_Method\_Pattern.ppt>)
        -   \[Siemens book\] Frank Buschmann, Regine Meunier, Hans
            Rohnert, Peter Sommerlad, and Michael Stal.
            *Pattern-Oriented Software Architecture: A System of
            Patterns*, Wiley, 1996.
        -   \["Gang of Four" (GoF) book\] Erich Gamma, Richard Helm,
	        Ralph Johnson, and John Vlissides.  *Design Patterns:
	        Elements of Reusable Object-Oriented Software*, Addison
	        Wesley, 1995.  Patterns*, Wiley, 1996.
		-   Mary Shaw. 
		    [Some Patterns for Software Architecture ](<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>), 
            In John M. Vlissides, James O. Coplien, and Norman 
            L. Kerth, editors, *Pattern Languages of Program Design 
            2*, Addison Wesley, 1996, pages 255-270. 
            \[[local](<localcopy/Shaw\_Patterns\_Arch.pdf>)\]


@.  <a name="FowlerDSLintro"></a> 
    **(5, 14-21 Feb) Discuss Fowler's introductory DSL example**

    a.  Martin Fowler. [An Introductory Example 
	    ](<http://www.informit.com/articles/article.aspx?p=1592379>), 
	    Chapter 1, *Domain-Specific Languages*, Addison Wesley, 2011. 

    #.  Martin Fowler. Using Domain-Specific Languages, Chapter 2, 
	    *Domain-Specific Languages*, Addison Wesley, 2011. 


### External DSLs

@.  <a name="StateMachineDSL"></a>
    **(dates on items) Discuss State Machine External DSLs** based on Martin
    Fowler's Secret Panel Controller (State Machine) DSLs

	a.  **(2-5, 14-26 Feb)** Martin Fowler. *Domain Specific Languages*,
        Addison Wesley, 2011.

	    -   Fowler introduces the running example, the Secret Panel
            Controller (State Machine) case study, in
            [DSL Chapter 1
			](<http://www.informit.com/articles/article.aspx?p=1592379>))
	    -   Fowler DSL Chapter 1 
		    "[An Introductory Example 
	        ](<http://www.informit.com/articles/article.aspx?p=1592379>)"
        -   Fowler DSL Chapter  2 "Using Domain-Specific Languages"
		-   Fowler DSL Chapter  3 "Implementing DSLs"
		-   Fowler DSL Chapter  5 "Implementing an External DSL"
		-   Fowler DSL Chapter  8 "Code Generation"
		-   Fowler DSL Chapter 11 "Semantic Model"
		-   Fowler DSL Chapter 17 "Delimiter-Directed Translation"
		-   Fowler DSL Chapter 18 "Syntax-Directed Translation"
		-   Fowler DSL Chapter 21 "Recursive Descent Parser"
		-   Fowler DSL Chapter 21 "Parser Generator"
		-   Fowler DSL Chapter 22 "Parser Combinator"
		-   Fowler DSL Chapter 51 "State Machine"
		-   Fowler DSL Chapter 52 "Transformer Generation"
		-   Fowler DSL Chapter 55 "Model Aware Generation"
		-   Fowler DSL Chapter 56 "Model Ignorant Generation"
		-   Fowler's [List of DSL Patterns 
		    ](<http://martinfowler.com/dslCatalog/>) from DSL book.
			
    #.  Other items from the instructor's notes
	
		-   [Mealy Machine Description and Exercise 
		    ](<MealyMachineSimulator.html>) gives a formal description 
		    of this kind of state machine 
        -   [Recursive Descent Parsing 
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/11ExprLangParsing.html#recursive-descent-parsing>)
		    gives a set of (Haskell) program templates for recursive descent
		    parsers
        -   [Parsing Combinators
            ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/11ExprLangParsing.html#parsing-combinators>)
            describes a preliminary set of (Haskell) parsing
            combinators for recursive descent parsers
		-   Wikipedia entry on [Parsing Combinator 
		    ](<https://en.wikipedia.org/wiki/Parser_combinator>) 


	    ***Scala versions (2009)***

    #.  Scala notes

        -   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.

        -   [Scala references ](<#scala>) below


    #.  **(21 Feb)** Graphviz and `dot` language reference and
        examples (looked at examples in class)

        -   Note: On my iMacs, I used Homebrew to install the 
		    package `graphviz`.
        -   [Graphviz: Graph Visualization Software 
		    ](<http://www.graphviz.org>)
			and the little language/tool `dot`
	    -   [`ExprLangModDep.gv`](<Graphviz/ExprLangModDep.gv>) --
			[`script`](<Graphviz/ExprLangModDep.sh>) --
	        [`png` output ](<Graphviz/ExprLangModDep.png>) 
	    -   [`DFA01.gv`](<Graphviz/DFA01.gv>) --
			[script](<Graphviz/DFA01.sh>) --
	        [`pdf` output ](<Graphviz/DFA01.pdf>) 
	    -   [`NFA01.gv`](<Graphviz/NFA01.gv>) --
			[script](<Graphviz/NFA01.sh>) --
	        [`svg` output ](<Graphviz/NFA01.svg>) 
	    -   [`NFA01a.gv`](<Graphviz/NFA01a.gv>) --
			[script](<Graphviz/NFA01a.sh>) --
	        [`svg` output ](<Graphviz/NFA01a.svg>) 
	    -   [`Infix1plus1b.gv`](<Graphviz/Infix1plus1b.gv>) --
			[script](<Graphviz/Infix1plus1b.sh>) --
	        [`png` output ](<Graphviz/Infix1plus1b.png>) 


    #.  **(14 Feb)** Scala State Machine Semantic Model
        (Ch. 1, 3, 11)

	    -   [StateMachine.scala
	        ](<StateMachineDSL/Scala/StateMachine.scala>)
		-   [StateMachineTest.scala
	        ](<StateMachineDSL/Scala/StateMachineTest.scala>)
		-   [CommandChannel.scala (mock)
		    ](<StateMachineDSL/Scala/CommandChannel.scala>)
		-   [StateMachineDirect.sh test script 
		    ](<StateMachineDSL/Scala/StateMachineDirect.sh>) 


    #.  **(21 Feb)** Scala XML-based External DSL (Ch. 1, 3, 5)

	    -   [StateMachineXMLTest .scala
            ](<StateMachineDSL/Scala/StateMachineXMLTest.scala>)
		-   [IncrementalStateMachineBuilder.scala 
		    ](<StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala>)
		-   [input file SecretPanel.xml
		    ](<StateMachineDSL/Scala/SecretPanel.xml>)
		-   [StateMachineXML.sh test script 
		    ](<StateMachineDSL/Scala/StateMachineXML.sh>) 


    #.  **(16 Feb)** Scala Custom External DSL with a
	    Delimiter-Directed parser (Ch. 1, 3, 5, 17)

		-   [DelimiterDSLTest.scala 
		    ](<StateMachineDSL/Scala/DelimiterDSLTest.scala>)
		-   [IncrementalStateMachineBuilder.scala 
		    ](<StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala>)
		-   [input file CustomExternalStateMachineDSL.dsl 
		    ](<StateMachineDSL/Scala/CustomExternalStateMachineDSL.dsl>)
		-   [DelimiterDSL.sh test script 
	        ](<StateMachineDSL/Scala/DelimiterDSL.sh>) 

    #.  **(19 Feb)** Scala Custom External DSL with hand-coded Ad Hoc
	    Recursive-Descent parser (Ch. 1, 3, 5, 21)


		-   [RecursiveDescentTest.scala
	        ](<StateMachineDSL/Scala/RecursiveDescentTest.scala>) 
		-   [IncrementalStateMachineBuilder.scala
		    ](<StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala>)
		-   [input file CustomExternalStateMachineDSL2.dsl
		    ](<StateMachineDSL/Scala/CustomExternalStateMachineDSL2.dsl>)
		-   [RecursiveDescent.sh test script 
	        ](<StateMachineDSL/Scala/RecursiveDescent.sh>) 


    #.  **(21 Feb briefly)** Scala Custom External DSL (using Scala
	    parser combinator library) with embedded state machine builder
	    (Ch. 1, 3, 5, 22)

        -   [CombinatorParserBuilderTest.scala
		    ](<StateMachineDSL/Scala/CombinatorParserBuilderTest.scala>)
		-   [IncrementalStateMachineBuilder.scala
		    ](<StateMachineDSL/Scala/IncrementalStateMachineBuilder.scala>)
		-   [input file CustomExternalStateMachineDSL2.dsl
		    ](<StateMachineDSL/Scala/CustomExternalStateMachineDSL2.dsl>)
		-   [CombinatorParserBuilder.sh test script
		    ](<StateMachineDSL/Scala/CombinatorParserBuilder.sh>)


    #.  **(21 Feb briefly)** Scala Custom External DSL (using Scala
	    parser combinator library) with full AST construction (Ch. 1,
	    3, 5, 22)

        -   [CombinatorParserASTTest.scala
		    ](<StateMachineDSL/Scala/CombinatorParserASTTest.scala>)
        -   [input file CustomExternalStateMachineDSL2.dsl
		    ](<StateMachineDSL/Scala/CustomExternalStateMachineDSL2.dsl>)
        -   [CombinatorParserAST.sh test script
		    ](<StateMachineDSL/Scala/CombinatorParserAST.sh>)


    #.  **(21 Feb briefly)** Scala Static C Code Generator with
        Model-Aware target platform library (Ch. 1, 3, 5, 8, 52, 55)

		-   [StaticC\_GeneratorTest.scala 
            ](<StateMachineDSL/Scala/StaticC\_GeneratorTest.scala>)
		-   [StaticC\_Generator.sh test script 
	        ](<StateMachineDSL/Scala/StaticC\_Generator.sh>) 
		-   [generated C output file output.c
            ](<StateMachineDSL/Scala/output.c>)
        -   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. 


    #.  **(21 Feb)** Scala Graphviz Dot Language Code Generator 
	    (added 2018) (Ch. 1, 3, 5, 8, 52)

		-   [GraphVizCodeGen.scala 
            ](<StateMachineDSL/Scala/GraphVizCodeGen.scala>)
		-   [GraphVizCodeGenTest.scala 
            ](<StateMachineDSL/Scala/GraphVizCodeGenTest.scala>) 
		-   [GraphVizCodeGen.sh test script 
	        ](<StateMachineDSL/Scala/GraphVizCodeGen.sh>) 
		-   [generated Graphviz Dot output file graph.gv 
            ](<StateMachineDSL/Scala/graph.gv>)  (see test script)
		-   [Scalable Vector Graphics output from dot graph.svg 
            ](<StateMachineDSL/Scala/graph.svg>)  (see test script)
		-   [PDF output from dot graph.pdf 
            ](<StateMachineDSL/Scala/graph.pdf>) (see test script)


@.  **(16 Feb) Announce homework
    [Assignment \#1 ](<../homework/658hw01.html>) and
    [Assignment \#2 ](<../homework/658hw02.html>)**


@.  **(23 Feb) Discuss [Metaprogramming](<Metaprogramming.html>)**

    Note: We return to this topic near the end of the semester with an
    emphasis on Python 3 metaprogramming features.


### Internal DSLs

@.  <a name="CompConfigDSL"></a>
    **(dates on items) Discuss Fowler's Computer Configuration Internal
    DSLs** (Ch. 4, 35, 36, 38)

	a.  Background: Martin Fowler. *Domain Specific Languages*,
        (Addison Wesley, 2011).

		-   Martin Fowler's 
		    [List of DSL Patterns 
		    ](<http://martinfowler.com/dslCatalog/>) 
		    from *Domain Specific Languages*, Addison Wesley, 2011 
	    -   Fowler DSL Chapter 1 
		    "[An Introductory Example 
	        ](<http://www.informit.com/articles/article.aspx?p=1592379>)"
        -   Fowler DSL Chapter  2 "Using Domain-Specific Languages"
		-   Fowler DSL Chapter  3 "Implementing DSLs"
		-   Fowler DSL Chapter  4 "Implementing an Internal DSL"
		-   Fowler DSL Chapter 11 "Semantic Model"
		-   Fowler DSL Chapter 13 "Context Variable"
		-   Fowler DSL Chapter 32 "Expression Builder"
		-   Fowler DSL Chapter 33 "Function Sequence"
		-   Fowler DSL Chapter 34 "Nested Functions"
		-   Fowler DSL Chapter 36 "Object Scoping"
		-   Fowler DSL Chapter 37 "Closure"
		-   Fowler DSL Chapter 38 "Nested Closure"
		-   Fowler DSL Chapter 39 "Literal List"
		-   Fowler DSL Chapter 40 "Literal Map"


        ***Scala versions (2009)***

    #.  **(23 Feb)** [Scala semantic model (shared)
		](<CompConfigDSL/Scala/Computer.scala>)

    #.  **(23, 26 Feb)** [Scala internal DSL using Method Chaining
	    ](<CompConfigDSL/Scala/CompConfigChaining.scala>)

    #.  **(26 Feb)** [Scala internal DSL using Nested Closures and Object 
	    Scoping ](<CompConfigDSL/Scala/CompConfigClosure.scala>)

	#.  [CompConfig.sh test script 
	    ](<CompConfigDSL/Scala/CompConfig.sh>) 


@.  <a name="EmailMessageDSL"></a>
    **(26 Feb) Discuss Fowler's Email Message Building Internal DSL** 
	(Ch. 35)

	a.  Background: Martin Fowler. *Domain Specific Languages*,
        (Addison Wesley, 2011). See listing of chapters under Computer
        Configuration internal DSL above.

        ***Scala versions (2009)***

    #.  [Scala internal DSL using Method Chaining and Progressive Interfaces 
	    ](<EmailDSL/Scala/EmailProgressive.scala>)

	#.  [EmailProgressive.sh test script 
	    ](<EmailDSL/Scala/EmailProgressive.sh>)


@.  <a name="LairDSL"></a> 
    **(see dates on items) Explore Fowler's Lair Configuration DSLs**

    a.  Background on Lair DSL

        -   **(28 Feb; 2-7 Mar)** Case study: Martin Fowler's 
		    [One Lair and Twenty Ruby DSLs 
		    ](<http://media.pragprog.com/titles/twa/martin\_fowler.pdf>), 
            Chapter 3, 
            [*The ThoughtWorks Anthology: Essays on Software Technology 
			and Innovation* 
			](<http://pragprog.com/book/twa/thoughtworks-anthology>), 
            The Pragmatic Bookshelf, 2008 
			[\[local copy](<LairDSL/FowlerOneLairTwentyDSLs.pdf>)\]
        -   Source code: 
		    \[[entire Thoughtworks book 
			](<https://pragprog.com/titles/twa/source\_code>)\] 
			\[[Fowler's Ruby DSLs ](<LairDSL/Ruby>)\]
        -   Patterns (repeated from above): Martin Fowler's 
		    [List of DSL Patterns 
		    ](<http://martinfowler.com/dslCatalog/>) 
		    from *Domain Specific Languages*, Addison Wesley, 2011 

	#.  Background on internal DSLs: Martin Fowler. *Domain Specific
	    Languages*, (Addison Wesley, 2011). See chapters under
	    Computer Configuration internal DSL above.

    #.  Background on Lua
	
        -   See [Lua references ](<#lua>) below

		-   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.
			
        -   At the terminal command line, `lua5.1 testNN.lua` compiles
            and executes the test driver program for the DSL with
            files builder program `builderNN.lua` and DSL script
            `rulesNN.lua`.

    #.  **(28 Feb Python)** Shared modules
	
	    Fowler's Ruby source
		
		-   [Semantic model (model.rb) ](<LairDSL/Ruby/model.rb>)
		-   [Test Driver for semantic model (rules0.rb) 
		    ](<LairDSL/Ruby/rules0.rb>)
		
		Lua (2013)

        -   [Class support module (for implementing classes in Lua) 
	        ](<LairDSL/Lua/class\_support.lua>) 
        -   [Semantic model ](<LairDSL/Lua/model.lua>) 
        -   [Test driver for semantic model (rules00.lua) 
		    ](<LairDSL/Lua/rules00.lua>) 
			
        Python 3 (2018)
		
        -   [Semantic model ](<LairDSL/Python/model.py>) 
        -   [Test driver for semantic model (rules00.py) 
		    ](<LairDSL/Python/rules00.py>) 


    #.  **(2 Mar Python)** Internal DSL using Global Function Sequence
        pattern
	
	    Fowler's Ruby
	
	    -   [builder module (builder8.rb) 
		    ](<LairDSL/Ruby/builder8.rb>) 
		-   [dsl script (rules8.rb) 
		    ](<LairDSL/Ruby/rules8.rb>) 

	    Lua (2013)
	
	    -   [builder module (builder08.lua) 
		    ](<LairDSL/Lua/builder08.lua>) 
		-   [dsl script (rules08.lua) 
		    ](<LairDSL/Lua/rules08.lua>) 
		-   [test driver (test08.lua) 
		    ](<LairDSL/Lua/test08.lua>) 

	    Python 3 (2018)
	
	    -   [builder module (builder08.py) 
		    ](<LairDSL/Python/builder08.py>) 
		-   [direct execution test of DSL script (rules08x.py) 
		    ](<LairDSL/Python/rules08x.py>) 
		-   [dynamically loaded dsl script (rules08.py) 
		    ](<LairDSL/Python/rules08.py>) 
		-   [test driver for dynamically loaded dsl script (test08.py) 
		    ](<LairDSL/Python/test08.py>) 


    #.  **(7 Mar Python)** Internal DSL using Class Method Function
        Sequence and Method Chaining patterns

		Fowler's Ruby

        -   [builder module (builder11.rb) 
		    ](<LairDSL/Ruby/builder11.rb>)
        -   [dsl script (rules11.rb) 
			](<LairDSL/Ruby/rules11.rb>)

		Lua (2013)

        -   [builder module (builder11.lua) 
		    ](<LairDSL/Lua/builder11.lua>)
        -   [dsl script (rules11.lua) 
			](<LairDSL/Lua/rules11.lua>)
		-   [test driver (test11.lua) 
		    ](<LairDSL/Lua/test11.lua>) 
		
		Python 3 (2018)

        -   [builder module (builder11.py) 
		    ](<LairDSL/Python/builder11.py>)
        -   [dynamically loaded dsl script (rules11.py) 
			](<LairDSL/Python/rules11.py>)
		-   [test driver for dynamically loaded dsl script (test11.py) 
		    ](<LairDSL/Python/test11.py>) 


    #.  **(7 Mar Python)** Internal DSL using Expression Builder and
        Method Chaining patterns
	
		Fowler's Ruby
		
        -   [builder module (builder14.rb)
	        ](<LairDSL/Ruby/builder14.rb>)
        -   [dsl script (rules14.rb)
		    ](<LairDSL/Ruby/rules14.rb>)

		Lua (2013)
		
        -   [builder module (builder14.lua)
	        ](<LairDSL/Lua/builder14.lua>)
        -   [dsl script (rules14.lua)
		    ](<LairDSL/Lua/rules14.lua>)
		-   [test driver (test14.lua)
		    ](<LairDSL/Lua/test14.lua>)
	
		Python 3 (2018)
		
        -   [builder module (builder14.py)
	        ](<LairDSL/Python/builder14.py>)
        -   [dynamically loaded dsl script (rules14.py)
		    ](<LairDSL/Python/rules14.py>)
		-   [test driver for dynamically loaded dsl script (test14.py)
		    ](<LairDSL/Python/test14.py>)


    #.  Internal DSL using Nested Closures pattern
	
	    Fowler's Ruby 
		
        -   [builder module (builder3.rb) 
	        ](<LairDSL/Ruby/builder3.rb>) 
		-   [dsl script (rules3.rb) 
			](<LairDSL/Ruby/rules3.rb>) 

	    Lua (2013)
		
        -   [builder module (builder03.lua) 
	        ](<LairDSL/Lua/builder03.lua>) 
		-   [dsl script (rules03.lua) 
			](<LairDSL/Lua/rules03.lua>) 
		-   [test driver (test03.lua) 
			](<LairDSL/Lua/test03.lua>)
			
		Python 3 -- none yet. (Python's weak syntactic support for
        lambdas does not allow the relatively direct approach usable
        in Ruby, Scala, and Lua.)
 
 
    #.  Internal DSL using Expression Builder, Object Scoping, and
        Method Chaining patterns
		
		Fowler's Ruby 
		
        -   [builder module (builder17.4b) 
			](<LairDSL/Ruby/builder17.rb>) 
		-   [dsl script (rules17.rb) 
			](<LairDSL/Ruby/rules17.rb>) 

		Lua  (2013)
		
        -   [builder module (builder17.lua) 
			](<LairDSL/Lua/builder17.lua>) 
		-   [dsl script (rules17.lua) 
			](<LairDSL/Lua/rules17.lua>) 
		-   [test driver (test17.lua) 
			](<LairDSL/Lua/test17.lua>)
			
		Python 3 -- none yet


    #.  Internal DSL using Literal Collection pattern
	
	    Fowler's Ruby
		
	    -   [builder module (builder22.rb) 
		    ](<LairDSL/Ruby/builder22.rb>)
		-   [dsl script (rules22.rb) 
		    ](<LairDSL/Ruby/rules22.rb>)

        Lua (2013)
		
	    -   [builder module (builder22.lua) 
		    ](<LairDSL/Lua/builder22.lua>)
		-   [dsl script (rules22.lua) 
		    ](<LairDSL/Lua/rules22.lua>)
		-   [test driver (test22.lua) 
            ](<LairDSL/Lua/test22.lua>)

        Python 3 -- none yet

    #.  **(5 Mar Python)** External DSL using Parser/Builder (no
	    corresponding example in Fowler book chapter)
		
		Lua (2013)
		
        -   Note: This program requires installation of a Lua LPEG
            library via luarocks. It must be compatible with whatever
            version of Lua is being used.
        -   [builder module (builderLPEG1.lua) 
			](<LairDSL/Lua/builderLPEG1.lua>)
		-   [dsl script (rulesLPEG1.dsl) 
			](<LairDSL/Lua/rulesLPEG1.dsl>)
		-   [test driver (testLPEG1.lua) 
			](<LairDSL/Lua/testLPEG1.lua>)
			
		Python 3 (2018)
		
        -   Note: This program requires installation of the Python 3
		    package [Parsita ](<https://github.com/johnthagen/parsita>), 
			a parser combinator library similar to Scala's
        -   [builder module (builderParsita1.py) 
			](<LairDSL/Python/builderParsita1.py>)
		-   [dsl script (rulesParsita1.dsl) 
			](<LairDSL/Python/rulesParsita1.dsl>)
		-   [test driver (testParsita1.py) 
			](<LairDSL/Python/testParsita1.py>)


@.  **(5 Mar) Announce homework
    [Assignment \#3 ](<../homework/658hw03.html>)**


@.  <a name="SandwichDSL"></a> 
    **(not discussed, but an alternative context for Assignment \#3)**
    Use Sandwich DSL Case Study

    a.  Notes

        -   Haskell and Scala versions are similar expansions of the
            original Lua version
		-   [Haskell references ](<#haskell) below
        -   [Scala references ](<#scala>) below
		-   [Lua references ](<#lua>) below

    #.  Haskell version (2014, 2017) using algebraic data types
	    
		-   [Sandwich DSL case study (Haskell)
		    ](<SandwichDSL/Haskell/SandwichDSL.html>)
		-   [Haskell source 
		    ](<SandwichDSL/Haskell/SandwichDSL\_base.hs>)

    #.  Scala version (2016) using case classes
	    
		-   [Sandwich DSL case study (Scala)
		    ](<SandwichDSL/Scala/SandwichDSL\_Scala.html>)
		-   [Scala source
		    ](<SandwichDSL/Scala/SandwichDSL\_base.scala>)

    #.  Lua version (2013) implements slightly different problem

        -   [Problem and solution description
		    ](<SandwichDSL/Lua/SandwichDSL\_Lua.html>)
        -   [Semantic Model module
            ](<SandwichDSL/Lua/sandwich\_model.lua>)
        -   [Builder module implementing DSL applying 
		    Function Sequence pattern 
			](<SandwichDSL/Lua/sandwich\_builder.lua>)
        -   [Test driver ](<SandwichDSL/Lua/test\_sandwichDSL.lua>)


@.  **(9 Mar)** No formal class. 
    Work on new <a href = "../homework/658hw03.html">Assignment \#3</a>. 
	Study the following handouts for discussion after Spring Break
	
	a.  **(assigned first week of semester)** 
	    James Coplien, Daniel Hoffman, and David Weiss. 
		[Commonality and Variability in Software Engineering 
		](<localcopy/CoplienCommonalityVariability.pdf>), 
        *IEEE Software*, Vol. 15, No. 6, November 1998. 

    #.  Paper "A Little Language for Surveys: Constructing an Internal 
	    DSL in Ruby" <a href = "#SurveyDSL">BELOW</a>

    #.  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.
		
		There is m<ore information about both labeled digraphs and the
        Wizard's adventure game <a href = "#LabeledDigraph">BELOW</a>.


@.  **(12-16 Mar) Enjoy Spring Break!**


### Analysis and Design of DSLs 

@.  **(19-21, 2-6 Apr) Resume direct discussion of 
    [Domain Specific Languages 
	](<DomainSpecificLanguages.html>) notes**


@.  **(21-26 Mar)
    Discuss commonality and variability analysis** paper:

    James Coplien, Daniel Hoffman, and David Weiss.
	[Commonality and Variability in Software Engineering 
	](<localcopy/CoplienCommonalityVariability.pdf>),
	*IEEE Software*, Vol. 15, No. 6, November 1998.


@.   <a name="SurveyDSL"></a> 
    **(dates below) Examine Cunningham's Survey DSL case study**, in
    particular the analysis and DSL design

    a.  **(28 Mar; 2 Apr) Discuss paper:** 
	    H. Conrad Cunningham.  A Little Language for Surveys: 
		Constructing an Internal DSL in Ruby, In *Proceedings
	    of the ACM SouthEast Conference*, 6 pages, March 2008.

		-   [manuscript   ](<SurveyDSL/Ruby/surveyLangFinal.pdf>)
	    -   [presentation ](<SurveyDSL/Ruby/surveyLanguage4.ppt>) 
	    -   [improved paper introduction section
		    ](<SurveyDSL/Ruby/LittleLanguageSurveys\_NewIntro.pdf>) 

    #.  **(2 Apr briefly)** Ruby source code (2006, 2008)

        -   [README file ](<SurveyDSL/Ruby/README.txt>) 
	    -   [Ruby source code SurveyLanguage.rb 
		    ](<SurveyDSL/Ruby/SurveyLanguage.rb>)
	    -   [test internal DSL input file 
		    ](<SurveyDSL/Ruby/survey.rb>) 
	    -   [test internal DSL input file with errors
		    ](<SurveyDSL/Ruby/surveyErrors.rb>) 

@.  **(dates below) Study object-oriented software development**

    a.  (for reference) Study domain analysis
   
        -   (not updated) Instructor's slides on 
		    [Domain Modeling (Powerpoint)](<slides/DomainModeling.ppt>), 
            for course registration system example 

        -   Alistair Cockburn. Introduction, Chapter 1 in *Writing 
            Effective Use Cases*, Addison-Wesley, 2001. 

        -   Doug Rosenberg with Kendall Scott. Domain Modeling,
            Chapter 2 in *Use Case Driven Object Modeling with UML*, 
	        Addison Wesley 1999. 

        -   Doug Rosenberg with Kendall Scott. Use Case Modeling,
            Chapter 3 in *Use Case Driven Object Modeling with UML*, 
	        Addison Wesley 1999.

    #.  **(6-13 Apr)** Instructor's notes on
		[Object-Oriented Software Development ](<OOSoftDev.html>)

    #.  **(6-11 Apr)** Instructor's notes on
		[Programming Paradigms ](<ProgrammingParadigms.html>) 
		-- a draft "chapter" from the evolving "textbook" *Exploring
		Languages using Interpreters and Functional Programming*
		
		-   [Object-oriented 
		    ](<ProgrammingParadigms.html#object-oriented>)
		
		-   [Prototype-based 
		    ](<ProgrammingParadigms.html#prototype-based>)

    #.  **(9 Apr)** Discuss type systems terminology from 
	    [Python 3 Metaprogramming 
		](<PythonMetaprogramming/Py3RefMeta01.html>) 
		notes
	
	    -   [Type system concepts
		    ](<PythonMetaprogramming/Py3RefMeta02.html#type-system-concepts>)
			
        -   [Python type system 
		    ](<PythonMetaprogramming/Py3RefMeta02.html#python-type-system>)


    #.  (for reference) Instructor's notes on the
		[Kinds of Polymorphism 
		](<https://john.cs.olemiss.edu/~hcc/csci450/notes/HaskellNotes/04Lists450.html#kinds-of-polymorphism>)


@.  **(13 Apr) Distribute [Assignment #4 (Final Project) 
    ](<../homework/658hw04.html>)**


@.  <a name = "CRC"></a> 
    **(dates below) Continue study of object-oriented software
    development**

    a.  **(16-18 Apr)** Instructor's slides on 
        [Using CRC Cards (Class-Responsibility-Collaboration) 
        ](<UsingCRC.html>) (HTML)

        -   (handout, for reference) Kent Beck and Ward Cunningham.
		    [A Laboratory for Teaching Object-Oriented Thinking 
			](<http://c2.com/doc/oopsla89/paper.html>),
		    In *Proceedings of the OOPSLA'89 Conference*, ACM, 1989.

        -   (for reference) Paul Gestwicki. [CRC Card Analysis (YouTube) 
		    ](<https://www.youtube.com/watch?v=otKUer13HnA>), 
		    Ball State University, February 2016.

    #.  (for reference) Ralph E. Johnson and Brian Foote.
        [Designing Reusable Classes 
		](<http://www.laputan.org/drc/drc.html>),
        *Journal of Object-Oriented Programming*, 
		Vol. 1, No. 2, pages 22-35, June/July 1988.

    #.  (for reference) [A simple example of the open-closed principle 
	    ](<http://joelabrahamsson.com/a-simple-example-of-the-openclosed-principle/>) 

    #.  (for reference) [SOLID Design Principles 
	    ](<https://www.vikingcodeschool.com/software-engineering-basics/solid-design-principles>), 
	    a look at the core SOLID principles through the lens of
	    modularity.

    #.  (for reference) "Uncle" Bob Martin video on 
	    ["SOLID Principles of Object-Oriented and Agile Design" 
		](<https://www.youtube.com/watch?v=TMuno5RZNeE>) 

@.  <a name="OOP"></a> (for reference, slides need additional
    updating) Examine object-oriented programming
			
    a.  Understanding Inheritance, based on Timothy Budd's
        *Understanding Object-Oriented Programming with Java*, 
		Chapter 8: 
		\[[Powerpoint](<slides/sle\_08\_Inheritance.ppt>)\]

    #.  Software Reuse, based on Timothy Budd's *Understanding
        Object-Oriented Programming with Java*, Chapter 10: 
        \[[Powerpoint](<slides/sle\_10\_Software\_Reuse.ppt>)\]

        -   [Scala translation of Frog dynamic composition example 
            ](<Frog/Scala/FrogTest.scala>)

    #.  Replacement and Refinement, loosely based on Timothy Budd's 
        *An Introduction to Object-Oriented Programming*, Third Edition,
        Section 16.2: 
		\[[Powerpoint](<slides/sle\_Replace\_Refine.ppt>)\]

    #.  Implications of Inheritance, based on Timothy Budd's 
        *Understanding Object-Oriented Programming with Java*, 
	    Chapter 11: 
        \[[Powerpoint](<slides/sle\_11\_Implication\_Inheritance.ppt>)\]

    #.  Multiple Inheritance, based on Timothy Budd's 
        *An Introduction to Object-Oriented Programming*, Third Edition, 
	    Chapter 13:
        \[[Powerpoint](<slides/sle\_Multiple\_Inheritance.ppt>)\]

        -   [Scala Modified Philosophical Frog example from Odersky et a
            ](<PhilFrog/Scala/PhilFrog.scala>)
        -   [Scala Modified Stackable traits example (IntQueue) 
		    from Odersky et al ](<Stackable/Scala/StackableTest.scala>)

    #.  Polymorphism, based on Timothy Budd's 
        *Understanding Object-Oriented Programming with Java*, 
	    Chapter 12:
	    \[[Powerpoint](<slides/sle\_12\_Polymorphism.ppt>)\]

    #.  Second Look at Classes, loosely based on Timothy Budd's 
        *An Introduction to Object-Oriented Programming*, 
	    Chapter 25 on Reflection and Introspection:
	    \[[Powerpoint](<slides/sle\_Second\_Look\_at\_Classes.ppt>)\]

    #.  Luca Cardelli and Peter Wegner. 
	    [On Understanding Types, Data Abstraction, and Polymorphism 
		](<localcopy/Cardelli\_On\_Understanding\_Types.pdf>), 
		*ACM Computing Surveys*, Vol. 17, No. 4, pp. 471-523, 1985.


@.  **(20-25 Apr) Do object-oriented analysis and design in class for
	a "choose your own adventure" game**

    a.  Reference: 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.
		
	    There is more information about both labeled digraphs and the
        Wizard's adventure game [BELOW](<#LabeledDigraph>),

    #.  [Adventure Game Analysis ](<AdventureSCV.html>)

        <a name="current_lecture"></a>

### Python 3 Metaprogramming

@.  **(25-30 Apr, 2-4 May) Explore
	[Python 3 Reflexive Metaprogramming
	](<PythonMetaprogramming/Py3RefMeta.html>)**

    a.  Introduction 
        \[[HTML](<PythonMetaprogramming/Py3RefMeta01.html>)\]
        \[[PDF ](<PythonMetaprogramming/Py3RefMeta01.pdf>)\]

    #.  Basic Features Supporting Metaprogramming 
        \[[HTML](<PythonMetaprogramming/Py3RefMeta02.html>)\]
        \[[PDF ](<PythonMetaprogramming/Py3RefMeta02.pdf>)\]

    #.  Decorators and Metaclasses (for Debugging Case Study)
        \[[HTML](<PythonMetaprogramming/Py3RefMeta03.html>)\]
        \[[PDF ](<PythonMetaprogramming/Py3RefMeta03.pdf>)]]


## Not Discussed Spring 2018 (For Reference)

### Ruby DSLs 

@.  <a name="RubyDSLs"></a>
    (for reference) Background on writing Ruby DSLs

    a.  Jim Freeze. [Creating DSLs with Ruby
	    ](<http://www.artima.com/rubycs/articles/ruby_as_dsl.html>),
	    Artima Developer, March 2006.

    #.  Jamis Buck. [Writing Domain Specific Languages
	    ](<http://weblog.jamisbuck.org/2006/4/20/writing-domain-specific-languages.html>),
	    *The Bucklog* (blog), 20 April 2006.

    #.  [Rake (Ruby Make) ](<https://ruby.github.io/rake/>),
	    a software management and build tool written as a Ruby 
		internal DSL


@.  <a name="ReaderDSL"></a>
    (for reference) Discuss Fowler's DSL Reader framework

    a.  Background: 

		-   Martin Fowler. 
		    [Language Workbenches: The Killer-App for Domain Specific Languages? 
		    ](<http://www.martinfowler.com/articles/languageWorkbench.html>)
            June 2005.
        -   Martin Fowler. [Generating Code for DSLs 
            ](<http://www.martinfowler.com/articles/codeGenDsl.html>), 
	        June 2005.

		***Ruby DSLs (2006)***

    #.  Ruby shared modules

        -   [DSL Reader Framework module (ReaderFramework.rb)
            ](<ReaderDSL/Ruby/ReaderFramework.rb>)
        -   [DSL Reader Utilities mix-in module (ReaderUtilities.rb)
	        ](<ReaderDSL/Ruby/ReaderUtilities.rb>)
        -   [Data input file (fowlerdata.txt) 
		    ](<ReaderDSL/Ruby/fowlerdata.txt>)
        -   [Text DSL description (dslinput.txt) 
		    ](<ReaderDSL/Ruby/dslinput.txt>)
        -   [XML DSL description (dslinput.xml)
		    ](<ReaderDSL/Ruby/dslinput.xml>)

    #.  Ruby direct configuration and testing of Reader

	    -   [BuilderDirect.rb 
		    ](<ReaderDSL/Ruby/BuilderDirect.rb>)

    #.  Ruby single-pass external text DSL

	    -   [TextSinglePass.rb 
		    ](<ReaderDSL/Ruby/TextSinglePass.rb>)

    #.  Ruby two-pass external XML DSL

	    -   [TwoPass.rb 
		    ](<ReaderDSL/Ruby/TwoPass.rb>)
	  	-   [class BuilderExternal source code generated by TwoPass.rb
		    ](<ReaderDSL/Ruby/GeneratedBuilderExternal.rb>)

    #.  Ruby internal DSL

	    -   [RubyDSL.rb 
		    ](<ReaderDSL/Ruby/RubyDSL.rb>)


### Language Processing

@.  (for reference) Study Parsing Expression Grammars (PEGs) 

    a.  Wikipedia entry on [Parsing Expression Grammar 
	    ](<http://en.wikipedia.org/wiki/Parsing\_expression\_grammar>) 

    #.  Bryan Ford. 
	    [Packrat Parsing: Simple, Powerful, Lazy, Linear Time 
		](<localcopy/Ford\_Packrat\_Parsing02.pdf>), 
	    Functional Pearl. In *Proceedings of the seventh ACM SIGPLAN 
	    International Conference on Functional Programming (ICFP 
	    '02)*, ACM, pp, 36-47, 2002. 

    #.  Bryan Ford. 
	    [Parsing Expression Grammars: A Recognition-Based Syntactic Foundation 
		](<localcopy/Ford\_Parsing\_Expression\_Grammars.pdf>), 
		*ACM SIGPLAN Notices*, Vol. 39, No. 1, pp. 111-122, 2004. 
		\[[slides](<http://www.brynosaurus.com/pub/lang/peg-slides.pdf>)\]


@.  (for reference) Arithmetic expression tree program skeletons

    a.  Background: These are expanded from the example in 
	    [Notes on Scala for Java Programmers 
		](<ScalaForJava/ScalaForJava.html>).

        ***Scala versions (2008-16)***

    #.  [Scala recursive function version using case classes 
	    ](<Expression/Scala/ExprCase.scala>)

    #.  [Scala traditional object-oriented version
        ](<Expression/Scala/ExprObj.scala>)


        ***Haskell version (2017)***

    #.  [Haskell Expression Tree Calculator case study
	    ](<Expression/Haskell/ExprTreeCalculator.html>)
		\[[source ](<Expression/Haskell/ExprTreeCalculator.hs>)\]


        ***Lua versions (2013-16)*** 

    #.  Lua recursive function versions (2013, 2014)

        -   [Lua Recursive Functions with Record Representation
			](<Expression/Lua/exprRecFuncRecord.lua>)
        -   [Lua Recursive Functions with List Representation
		    ](<Expression/Lua/exprRecFuncList2.lua>)
        -   [Lua Evaluation Function Table with List Representation
		    ](<Expression/Lua/exprEvalTable2.lua>)

    #.  Lua object-oriented versions (2013, 2016)

        -   [Lua Prototype Object-Based 
		    ](<Expression/Lua/exprObjBased.lua>)
        -   [Lua Object-Oriented with Inheritance
		    ](<Expression/Lua/exprObjInherit.lua>)

    #.  Lua LPEG parsers (2013)
	
	    -   Require installation of compatible LPEG library
        -   [Parser with captures 
		    ](<ExprParser/Lua/exprParser.lua>) 
		-   [Parser with semantic actions 
		    ](<ExprParser/Lua/exprParserSemantic.lua>) (changed
		    `unpack(t)` to `table.unpack(t)` for Lua 5.2 and 5.3)


### Exploring Languages using Interpreters

#### Haskell

@.  <a name="ExprLang"></a>
    (for reference, from 2017 CSci 450) 
    Explore the [Expression Language Syntax and Semantics (Chapter 10)
    ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/10ExprLangSynSem.html>)

    a.  Supplemental slides: 
	
	    -   [Expression Language Syntax and Semantics 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/ExprLangSynSemSlides.html>) 

    #.  Code in work:
	
	    -   [Module dependency graph 
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/ExprLangModDep.png>) 
        -   [Values module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/Values.hs>) 
        -   [Abstract Syntax module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/AbSynExpr.hs>) 
        -   [Environments module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/Environments.hs>) 
        -   [Evaluator module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/EvalExpr.hs>)
	    -   Expression Language parsing and REPL modules linked to Chapter 11 below
     	-   [Process AST 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/ProcessAST.hs>) --
            simplification and derivative code skeleton


@.  (for reference, from 2017 CSci 450) Explore the [Expression Language Parsing (Chapter 11)
    ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/11ExprLangParsing.html>)

    a.  Supplemental slides: 
	
	    -   [Expression Language Parsing 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/ExprLangParsingSlides.html>) 

    #.  Code in work:
	
	    -   [Module dependency graph 
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/ExprLangModDep.png>) 
        -   [Values module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/Values.hs>) 
        -   [Abstract Syntax module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/AbSynExpr.hs>) 
        -   [Environments module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/Environments.hs>) 
        -   [Evaluator module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/EvalExpr.hs>) 
        -   [Lexical analyzer module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/LexExpr.hs>) 
        -   [Recursive descent parser for infix language 
            ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/ParseInfixExpr.hs>) (simple expressions) 
        -   [Recursive descent parser for prefix language 
            ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/ParsePrefixExpr.hs>)
        -   [Prefix REPL module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/PrefixExprREPL.hs>) 
        -   [Infix REPL module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/InfixExprREPL.hs>) 
	    -   [Process AST 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/ProcessAST.hs>) 
        -   [Parser Combinators module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/ParserComb.hs>)


@.  (for reference, from 2017 CSci 450) Explore the [Expression Language Compilation (Chapter 12)
    ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/12ExprLangCompiling.html>)

    a.  Code in work:

        -   [Stack Virtual Machine? 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ExprLang/SInstr01.hs>) 


@.  <a name="ImpCore"></a> 
    (for reference, from 2017 CSci 450) Explore the Imperative Core Language: 
    No notes or slide yet, but the code follows

	a.  Modules
	
        -   [Values module
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ImpCore/Values.hs>) 
        -   [Abstract Syntax module
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ImpCore/AbSynImpCore.hs>) 
        -   [Environments module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ImpCore/Environments.hs>) 
        -   [Lexical analyzer module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ImpCore/LexImpCore.hs>) 
        -   [Recursive descent parser module
	         ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ImpCore/ParseImpCore.hs>) 
        -   [Evaluator module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ImpCore/EvalImpCore.hs>) 
        -   [REPL module 
	        ](<https://john.cs.olemiss.edu/~hcc/csci450/notes/ImpCore/ImpCore.hs>)


#### Lua

@.  <a name="ExprLang2016"></a> 
    (for reference, from 2016 CSci 450) Examine modularized Expression Language 1 interpreter 
	
    a.  Modules
	
	    -   [Module Usage Diagram
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/Module_Usage_Diagram_Interpreter_EL1.png>)
        -   [Utilities module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/utilities.lua>) 
		-   Parser module
		    [[Infix parser]
			](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/parser_infix_01.lua>) 
	     	[[Prefix parser]
			](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/parser_prefix_01.lua>) 
        -   [Abstract Syntax module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/abs_syn_01.lua>) 
        -   [Environment module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/environment.lua>) 
        -   [Values module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/values_01.lua>) 
        -   [Evaluator module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/evaluator_01.lua>) 
        -   [REPL module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/repl.lua>)

    #.  Scripts to execute and test:
	
        -   [Evaluator Test script 
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/test_01.lua>) 
        -   [Infix Parser Test script
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/driver_parser_infix_01.lua>) 
        -   [Prefix Parser Test script
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/driver_parser_prefix_01.lua>)
		-   [Run infix interpreter script
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/runinfix.lua>) 
		-   [Run prefix interpreter script
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ExprLang1/Lua/runprefix.lua>) 


@.  <a name="ImpCore2016"></a> 
    (for reference, from 2016 CSci 450) [Imperative Core Language
    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/ImpCore.html>)

    a.  Modules

	    -   [Module Usage Diagram 
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/Module_Usage_Diagram_Interpreter_EL1.png>) 
        -   [Utilities module 
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/utilities.lua>) 
		-   [Parser module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/parser_prefix_core2.lua>) 
        -   [Abstract Syntax module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/abs_syn_core2.lua>) 
        -   [Environment module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/environment.lua>) 
        -   [Values module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/values_01.lua>) 
        -   [Evaluator module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/evaluator_core2.lua>) 
        -   [REPL module
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/repl_core2.lua>) 

    #.  Run and test scripts

        -   [Evaluator Test script 
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/test_core.lua>) 
        -   [Prefix Parser Test script 
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/driver_parser_core.lua>) 
		-   [Run prefix interpreter script
		    ](<https://john.cs.olemiss.edu/~hcc/csci450/2016fall/notes/ImpCore/Lua/runcore2.lua>) 


#### Kamin Interpreters

@.  (for reference, not updated) Kamin Interpreters in Lua Toolset (KILT)

    a.  [Kamin-Budd Interpreters](<Kamin\_Budd\_interpreters/>)
	    
		Samuel N. Kamin. *Programming Languages: An Interpreter-Based
        Approach*, Addison-Wesley, 1990.
	
	    Note: I implemented the interpreter prototypes below in Lua 5.1 in
        2013 for the Fall offering of CSci 658 and for a potential
        future offering of CSci 450. Some aspects my not work with Lua
        5.2 or 5.3.
		
		I subsequently reimplemented the first with improved
        modularization in Lua in 2016 and then reimplemented it again
        in 2017 in Haskell.

    #.  Language/Interpreter-independent modules
	
	    -   [REPL Module (repl.lua) 
		    ] (<KILT/repl.lua>)\
        -   [Environment Module (environment.lua) 
		    ](<KILT/environment.lua>)
	    -   [Function Table Module (funtab.lua) 
		    ](<KILT/funtab.lua>)
		-   [Utilities Module (utilities.lua) 
		    ](<KILT/utilities.lua>)
		-   [Opcodes Factory Module (opcodes.lua) 
		    ](<KILT/opcodes.lua>)
		-   [Values Factory Module (values.lua) 
		    ](<KILT/values.lua>)
		-   [Parser Factory Module (parser.lua) 
		    ](<KILT/parser.lua>)
        -   [Evaluator Factory Module (evaluator.lua) ]
		    (<KILT/evaluator.lua>)
	
    #.  Kamin Chapter 1 Core language interpreter
	
        -   [Core Interpreter (Core.lua) 
		    ](<KILT/Core.lua>)
        -   [Core Opcodes (opcodes\_core.lua) 
		    ](<KILT/opcodes\_core.lua>)
		-   [Core Values Module (values\_core.lua) 
			](<KILT/values\_core.lua>)
		-   [Core Parser Module (parser\_core.lua)
		    ](<KILT/parser\_core.lua>)
		-   [Core Evaluator Module (evaluator\_core.lua)
		    ](<KILT/evaluator\_core.lua>)

    #.  Kamin Chapter 2 Lisp language interpreter
	
	    -   [Lisp Interpreter (Lisp.lua)
		    ](<KILT/Lisp.lua>)
		-   [Lisp Opcodes (opcodes\_lisp.lua)
		    ](<KILT/opcodes\_lisp.lua>)
        -   [Lisp Values Module (values\_lisp.lua)
		    ](<KILT/values\_lisp.lua>)
		-   [Lisp Parser Module (parser\_lisp.lua)
		    ](<KILT/parser\_lisp.lua>)
        -   [Lisp Evaluator Module (evaluator\_lisp.lua)
		    ](<KILT/evaluator\_lisp.lua>)
		-   [A few Lisp examples 
		    ](<KILT/LispExamplesKaminChap2.txt>)

    #.  Kamin Chapter 4 Scheme language interpreter
	
        -   [Scheme Interpreter (Scheme.lua) 
		    ](<KILT/Scheme.lua>)
        -   [Scheme Opcodes (opcodes\_scheme.lua) 
		    ](<KILT/opcodes\_scheme.lua>)
		-   [Scheme Values Module (values\_scheme.lua) 
		    ](<KILT/values\_scheme.lua>)
		-   [Scheme Parser Module (parser\_scheme.lua)
		    ](<KILT/parser\_scheme.lua>)
		-   [Scheme Evaluator Module (evaluator\_scheme.lua) 
		    ](<KILT/evaluator\_scheme.lua>)
		-   [A few Scheme examples 
		    ](<KILT/SchemeExamples.txt>)


### Modules and Frameworks 

@.  (for reference) Simple, silly Employee hierarchy example

    a.  [Scala (2008, 2010) ](<Employee/Scala/EmployeeTest.scala>)
	
	#.  [Ruby (2006) ](<Employee/Ruby/employee.rb>)


@.  (for reference) Examine a natural number arithmetic package
	
    This case study has implementations in five different
    languages (with some slight differences among the
    examples). So it can be used to compare implementations in
    different languages. 

    a.  Background on Peano arithmetic
        
		-   [Peano Axioms ](<http://en.wikipedia.org/wiki/Peano_axioms>),
            Wikipedia article
        -   [Peano's Axioms
		    ](<http://mathworld.wolfram.com/PeanosAxioms.html>),
			Wolfram MathWorld article

    #.  [Lua version (2013) ](<Nat/Lua/nats2.lua>)

    #.  Elixir version (2015)
	
		-   [Nat module  ](<Nat/Elixir/Nat.ex>)
        -   [test module ](<Nat/Elixir/Nat_Test.ex>)
        -   [test script ](<Nat/Elixir/Nat.exs>)

    #.  Scala versions (2012, 2016)

        -   [Functional object-oriented style with ordinary classes 
		    ](<Nat/Scala/TestNats.scala>)
        -   [Functional object-oriented style with case classes
		    ](<Nat/Scala/TestCaseObjNats.scala>)
        -   [Functional module style with case classes
            ](<Nat/Scala/TestCaseExtNats.scala>)

    #.  [Ruby version (2006) ](<Nat/Ruby/Nat.txt>)

    #.  Java version (2004, 2016), simpler, no generics
	
	    -   [abstract base class Nat ](<Nat/Java/Nat.java>) 
	    -   [subclass Zero ](<Nat/Java/Zero.java>) 
	    -   [subclass Succ ](<Nat/Java/Succ.java>) 
	    -   [subclass Err  ](<Nat/Java/Err.java>) 
	    -   [TestNat main program ](<Nat/Java/TestNat.java>) 



@.  (for reference) Abstract data types and modular design 

     a.  Background: Abstract data types
		
         -   Nell Dale and Henry Walker. Abstract specification techniques, 
             Chapter 1, In *Abstract Data Types: Specifications, 
             Implementations, and Applications*, 
		     pp. 1-34,D. C. Heath, 1996. 
         -   H. Conrad Cunningham, Yi Liu, and Jingyi Wang. 
	         Designing a flexible framework for a table abstraction,
		     Chapter 13 in Y. Chan, J. Talburt, and T. Talley, editors, 
		     *Data Engineering: Mining, Information, and Intelligence*, 
		     pp. 279-314, Springer, 2010. \
             \[[manuscript
			 ](<localcopy/Cunningham\_Table\_Abstraction.pdf>)\]
             \[[slides](<slides/TableFramework8.ppt>)\]

     #.  [Modular Design ](<ModularDesign.html>) 

     #.  [Data Abstraction ](<DataAbstraction.html>): 
	     \[[slides ](<slides/Data\_Abstraction\_rev2.ppt>)]

     #.  [Abstraction ](<Abstraction/Abstraction.html>) -- draft
         "chapter" from evolving "textbook" Exploring Languages with
         Interpreters and Functional Programming (some overlap with
         Data Abstraction document)
		 
     #.  Classic papers by David L. Parnas and associates:
    
         -   Kathryn Heninger Britton, R. Alan Parker, and David L. Parnas.
	         [A Procedure for Designing Abstract Interfaces for Device Interface Modules
	         ](<localcopy/Parnas\_Abstract\_Interfaces.pdf>),
	         In *Proceedings of the 5th International Conference on Software
             Engineering*, pp. 195-204, March 1981.
         -   David L. Parnas. 
             [On the Criteria To Be Used in Decomposing Systems into Modules 
	         ](<localcopy/Parnas\_Criteria\_Decomposing.pdf>),
	         *Communications of the ACM*, Vol. 15, No. 12, pp. 1053-1058, 1972.
         -   David L. Parnas. 
	         [On the Design and Development of Program Families 
		     ](<localcopy/Parnas\_Families.pdf>),
		     *IEEE Transactions on Software Engineering*, 
		     Vol. SE-2, No. 1, pp. 1-9, March 1976.
         -   David L. Parnas. 
	         [Designing Software for Ease of Extension and Contraction 
		     ](<localcopy/Parnas\_Extension\_Contraction.pdf>), 
		     *IEEE Transactions on Software Engineering*, 
		     Vol. SE-5, No. 1, pp. 128-138, March 1979.
         -   David L. Parnas, P. C. Clements, and D. M. Weiss. 
	         [The Modular Structure of Complex Systems 
		     ](<localcopy/Parnas\_Modular\_Structure.pdf>),
		     *IEEE Transactions on Software Engineering*, 
		     Vol. SE-11, No. 3, pp. 259-266, March 1985.

     #.  William R. Cook. [On Understanding Data Abstraction Revisited
         ](<http://www.cs.utexas.edu/~wcook/Drafts/2009/essay.pdf>). 
         In *Proceedings of OOPSLA*, October 2009.
         \[[local](<localcopy/Understanding_Data_Abstraction_Revisited.pdf>)\]


@.  (for reference) Explore consequences of software architectural mismatch.

    Paper: David Garlan, Robert Allen, and John Ockerbloom.
    [Architectural Mismatch: Why Reuse is So Hard 
	](<localcopy/ArchitecturalMismatch.pdf>),
    *IEEE Software*, Vol. 12, No. 6, November 1995.

    Instructor's notes on [Architectural Mismatch ](<Arch\_Mismatch.html>)

@.   (for reference) Examine the CookieJar ADT case study (in Scala) 

     a.  [Cookie Jar ADT Problem Description 
         ](<CookieJar/Scala/CookieJar\_problem.html>) 
  
     #.  [Specification concepts and notation 
         ](<CandyBowl/Lua/candybowl\_semantics.html#specifying-semantics>) 
         -- from Candy Bowl ADT description
        
     #.  Immutable CookieJar ADT Implementation in Scala (`ICookieJar`) 
         -- uses method chaining functional style with immutable objects

         -   [ADT specification as Scala trait 
             ](<CookieJar/Scala/immutable/ICookieJar.scala>) 
         -   [List version 
             ](<CookieJar/Scala/immutable/ICookieJarList.scala>) 
         -   [HashMap version 
             ](<CookieJar/Scala/immutable/ICookieJarMap.scala>) 
         -   [List of tuples version 
             ](<CookieJar/Scala/immutable/ICookieJarTupleList.scala>) 
         -   [Blackbox test script 
             ](<CookieJar/Scala/immutable/ICookieJarTest.scala>) 

     #.  Mutable CookieJar ADT Implementation in Scala (`CookieJar`) 
         -- uses object-oriented style with mutable state 

         -   [ADT specification as Scala trait 
             ](<CookieJar/Scala/mutable/CookieJar.scala>)
         -   [List version 
              [ArrayBuffer version 
             ](<CookieJar/Scala/mutable/CookieJarArrayBuffer.scala>) 
         -   [HashMap version 
             ](<CookieJar/Scala/mutable/CookieJarMap.scala>) 
         -   [List of tuples version 
             ](<CookieJar/Scala/mutable/CookieJarTupleList.scala>) 
         -   [Array version 
             ](<CookieJar/Scala/mutable/CookieJarArray.scala>) 
         -   [Blackbox test script 
             ](<CookieJar/Scala/mutable/CookieJarTest.scala>) 

     #.  [Similar specification and Ruby program 
         ](<CookieJar/Ruby/CookieJarRuby.txt>) 


@.  (for reference) Examine Carrie's Candy Bowl ADT (abstract data type) case study

    a.  Lua 

        -   [ADT Semantics  ](<CandyBowl/Lua/candybowl_semantics.html>) 
        -   [Hashed version ](<CandyBowl/Lua/candybowl_hash.lua>) 
        -   [Unsorted List version ](<CandyBowl/Lua/candybowl_list.lua>) 
        -   [Test driver    ](<CandyBowl/Lua/test_candybowl.lua>) 

    #.  Scala

        -   [CandyBowl trait ](<CandyBowl/Scala/CandyBowl.scala>)
        -   [CandyBowlList class ](<CandyBowl/Scala/CandyBowlList.scala>)


@.  <a name="LabeledDigraph"></a>
    (for reference) Examine the Labeled Digraph case study

    a.  Background:

        -   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.

        -   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.

    #.  Haskell solutions (2015)
        
        -   [Labelled Digraph Abstract Data Type 
		    ](<Digraph/Haskell/DigraphADT.html>) 
        -   List representation for vertices and edges:
            \[[module ](<Digraph/Haskell/DigraphADT\_List.hs>)\]
            \[[test module ](<Digraph/Haskell/DigraphADT\_TestList.hs>)\]
        -   Map representation for graph:
            \[[module ](<Digraph/Haskell/DigraphADT\_Map.hs>)\]
            \[[test module ](<Digraph/Haskell/DigraphADT\_TestMap.hs>)\]
  
    #.  Elixir solutions (2015)

        -   Tuple and list representation for graph:
            \[[module ](<Digraph/Elixir/Digraph\_List.ex>)\]
            \[[test module ](<Digraph/Elixir/Digraph\_Test.exs>)\]

    #.  Scala solutions (2016)
       
        -   Abstract data type specification and Scala trait (interface):
            \[[ADT interface ](<Digraph/Scala/Digraph.scala>)\]
        -   List representation for vertices and edges:
            \[[class source ](<Digraph/Scala/DigraphList.scala>)\]
            \[[test source ](<Digraph/Scala/Test_DigraphList.scala>)\]
        -   Map (HashMap) representation for graph:
            \[[class source ](<Digraph/Scala/DigraphMap.scala>)\]
            \[[test source ](<Digraph/Scala/Test_DigraphMap.scala>)\]

    #.  Using the Elixir Digraph ADT module to build the Wizard's
	    Adventure game (2015)

        -   [Wizard's Adventure game, Version 1, 
		    ](<Wizard/Elixir/wizards_game.ex>)
            adapted from Chapter 5, 6, and 17 of Conrad Barski's *Land of
            Lisp: Learn to Program in Lisp, One Game at a Time*,
			No Starch Press, 2011.

        -   [Wizard's Adventure game, Version 2, 
		    ](<Wizard/Elixir/wizards_game2a.ex>)
            that uses a higher order function to generate game actions 
			and improved handling of the game state. 


@.  (for reference) Examine the Dice of Doom game. 

    a.  Background: Conrad Barski. *Land of Lisp: Learn to Program in
        Lisp, One Game at a Time*, No Starch Press, 2011.

    b.  [Dice of Doom, Version 1a ](<Dice\_of\_Doom/Elixir/dice_of_doom_v1a.ex>),
        is a basic eagerly evaluated version (similar to that
        developed on pages 303-325 of *Land of Lisp*). This
        version supports either two human players or a human player
        and a simple, minimax search-based "AI" (artificial
        intelligence) opponent.

    c.  [Dice of Doom, Version 1b ](<Dice\_of\_Doom/Elixir/dice_of_doom_v1b.ex>),
        is an eager version above with an attempt at memoization of
        functions `neighbors` and `game_tree` using the Elixir `Agent`
        modules.
                
    d.  [Dice of Doom, Version 2a,
        ](<Dice\_of\_Doom/Elixir/dice_of_doom_v2a.ex>) is a lazy version 
        using Elixir `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 *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.


@.  (for reference) Explore Systematic generalization.
	
    a.  Hans A. Schmid.
		[Systematic Framework Design by Generalization 
		](<localcopy/SchmidSystematicDesignByGeneralization.pdf>),
		*Communications of the ACM*, Vol. 40, No. 10, pp. 48-51,
		October 1997.
	
	#.  Hans A. Schmid. 
		[Creating Applications From Components: 
		A Manufacturing Framework Design 
		](<localcopy/SchmidCreatingApplicationsFromComponents.pdf>),
		*IEEE Software*, Vol. 13, No. 6, November 1997. 

	#.  Hans A. Schmid. 
		Framework Design by Systematic Generalization,
        Chapter 15 in M. E. Fayad and R. E. Johnson, editors,
        *Domain-Specific Application Frameworks*, 
		pp. 353-378, Wiley, 2000. 
		   
    #.  Hans A. Schmid. OSEFA: Framework for Manufacturing,
		Chapter 4 in M. E. Fayad, D. C. Schmidt, and
		R. E. Johnson, editors, *Building Application Frameworks:
		Object-Oriented Foundations of Framework Design*,
		pp. 43-65, Wiley, 1999.

@.   (for reference) Mark Ardis, Nigel Daley, Daniel Hoffman, Harvey Siy, 
     and David Weiss. [Software Product Lines: A Case Study
	 ](<https://pdfs.semanticscholar.org/75bf/823305d898014d50ec4b47ed1d6cf42a17bf.pdf>),
	 *Software Practice and Experience*, Vol. 30, No. 7, 
	 pp. 825-847, 2000.


@.  (for reference) Frameworks, based on Timothy Budd's 
    *An Introduction to Object-Oriented Programming*, Third Edition, 
	Chapter 21.

    a.  Simple Sorting Framework in Scala

        -   [Low-level concrete Employee sorting
            ](<SortFramework/Scala/SortEmployee.scala>)
        -   [Insertion Sorting framework
		    ](<SortFramework/Scala/InsertionSorter.scala>)
        -   [Employee Sorting application of framework
            ](<SortFramework/Scala/EmployeeSorter.scala>)
        -   [Test code for Employee Sorting application of framework 
		    ](<SortFramework/Scala/TestEmployeeSorter.scala>)
		
    #.  Ice Cream Store discrete event simulation
	
        -   [Simulation framework 
		    ](<IceCreamStore/Scala/SimFramework.scala>)
        -   [Ice Cream Store application 
		    ](<IceCreamStore/Scala/IceCreamStoreApp.scala>)



@.  (for reference) Scala Divide-and-Conquer Framework, similar to the Java
    framework in the paper:
    
    H. C. Cunningham, Y. Liu, and C. Zhang. Using classic problems to
    teach Java framework design, *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.
    \[[manuscript 
	](<http://www.cs.olemiss.edu/~hcc/papers/classicProblems.pdf>)\]

    Note: The above paper was not discussed in class, but the Scala versions
    of the Divide-and-Conquer (immediately below) and Binary Tree Traversal
    (farther down on this page) frameworks were discussed.

    -   [Template-based Divide-and-Conquer Framework (DivConqTemplate) 
	    ](<DivConq/Scala/DivConqTemplate.scala>)
    -   [Strategy-based Divide-and-Conquer Framework (DivConqStrategy) 
        ](<DivConq/Scala/DivConqStrategy.scala>)
    -   [Traits for Problem and Solution descriptions for both frameworks
        (DivConqProblemSolution)
        ](<DivConq/Scala/DivConqProblemSolution.scala>)
    -   [Application of Template-based framework to QuickSort
        (QuickSortTemplateApp) 
        ](<DivConq/Scala/QuickSortTemplateApp.scala>)
    -   [Application of Strategy-based framework to QuickSort
        (QuickSortStrategyApp)
		](<DivConq/Scala/QuickSortStrategyApp.scala>)
    -   [Descriptor for QuickSort state for both QuickSort
        applications (QuickSortDesc)
        ](<DivConq/Scala/QuickSortDesc.scala>)



@.  (for reference) Binary Tree Visitor Scala Framework

    a.  Background:  H. C. Cunningham, Y. Liu, and C. Zhang.
	    Using classic problems to teach Java framework design, 
		*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. \
		\[[manuscript
        ](<http://www.cs.olemiss.edu/~hcc/papers/classicProblems.pdf>)\]

        *Scala versions (2008, 2010)*

    #.  Straightforward translation of the non-generic Java program to Scala
	
        -   [Top-level framework (BinTreeFramework) 
		    ](<BinTree/Scala/Nongeneric/BinTreeFramework.scala>)
		-   [Second-level Euler tour framework (EulerTourVisitor) 
            ](<BinTree/Scala/Nongeneric/EulerTourVisitor.scala>)
        -   [Second-level mapping visitor framework (MappingVisitor) 
		    ](<BinTree/Scala/Nongeneric/MappingVisitor.scala>)
		-   [Second-level breadth-first framework (BreadthFirstVisitor)
            ](<BinTree/Scala/Nongeneric/BreadthFirstVisitor.scala>)
		-   [Application of BinTree frameworks (BinTreeTest)
            ](<BinTree/Scala/Nongeneric/BinTreeTest.scala>)
		
    #.  Generic implementation of BinTree framework in Scala.

        -   [Top-level framework (BinTreeFramework) 
		    ](<BinTree/Scala/Generic/BinTreeFramework.scala>)
		-   [Second-level Euler tour framework (EulerTourVisitor)
            ](<BinTree/Scala/Generic/EulerTourVisitor.scala>)
		-   [Second-level breadth-first framework (BreadthFirstVisitor)
			](<BinTree/Scala/Generic/BreadthFirstVisitor.scala>)
        -   [Application of BinTree frameworks (BinTreeTest)
            ](<BinTree/Scala/Generic/BinTreeTest.scala>)


@.  <a name="Movable"></a> 
    (for reference) Study the Movable and Named Objects case study (in
    Lua but based on a Haskell case study by Thompson)

    a.  *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). 
		
        The "makeClass" function dynamically creates a "class" that
        has zero or more superclasses. It creates the class prototype
        object with an appropriate constructor/initialization
        function, appropriate default definitions of instance methods,
        and the needed settings of metaclasses and the `__index`
        metamethod to support the inheritance hierarchy.

    #.  Background reading on object-oriented programming languages:
		[Object-oriented
		](<Fundamentals/01Fundamental450.html#object-oriented>)
	  	subsection of the
	  	[Fundamental Concepts of Programming Languages 
		](<Fundamentals/01Fundamental450.html>)
	  	notes

    #.  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](<Movable/Lua/movable.lua>)
       (movable.lua)

    #.  Modularized Lua version with improved class support:	
	    
	    -   [class support module](<Movable/Lua/class_support.lua>)
	        (class_support.lua)
        -   [module using class-support](<Movable/Lua/movable2.lua>)
            (movable2.lua)
        -   [test driver](<Movable/Lua/movable2Test.lua>) 
	        (movable2Test.lua)
  
    #.  Other older versions:<
	
        -   [Haskell source](<Movable/Scala/MovableNamedTypes.hs>)
        -   [Scala source (partial)](<Movable/Scala/Movable.scala>)


@.  <a name = "prototype"></a>
    (for reference) Study the prototype-based programming example

    *Comments*: Lua is essentially a *prototype-based* programming
    language. A Lua table has its own state, a unique identity, and an
    independent lifecyle. By assigning function closures to
    identifier-style keys, a table can also have its own
    operations. The method-call syntax enables these operations to
    refer to its associated table conveniently.
	
	The Lua metatable and metamethod features enable a table to
    *delegate* some of its work conveniently to other tables. In
    particular, the `__index` metamethod enables accesses to data
    fields or operations not defined in one table to other tables.

    The previous "object-oriented" Arithmetic Expression Tree and
    Movable & Named Objects examples use Lua's prototype-based
    features to implement classes and inheritance structures.

	This module uses those features in a more straightforward
    prototype-based approach--by creating a "copy" of the prototype
    object. It provides two constructor functions, set up to use the
    method-call syntax.
	
	Constructor method `Prototype:new` creates a new object as a
    *shallow copy* of the table parameter `mixin` with other
    references *delegated* to object `self`. A call `Prototype:new`
    creates a basic object that delegates to object `Prototype`. If
    `obj` has been created by this `new` method, then a call of
    `obj:new` creates a new object that delegates to `obj` rather than
    `Prototype`.  (This is different from the way Lua classes are
    implemented.)

    Constructor method `Prototype:clone` creates a new object that is
    a *shallow copy* of object `self` and then mixes in the fields and
    methods from `mixin`. It delegates accesses to any undefined
    fields to whatever object `self` does.

    *Concepts*: Prototype object, delegation, shallow copy, mixin
	
    -   [Prototype-based programming with delegation and cloning
	    ](<Prototype/Prototype.lua>)
	-   [Test script](<Prototype/PrototypeTest.lua>)


@.  <a name="Rational"></a> (for reference) 
    Examine Rational Arithmetic case study (data abstraction)
	
	Note: I have rewritten this 2016 case study to use Haskell and
    incorporated it into the draft Abstraction "chapter" of Exploring
    Languages with Interpreters and Functional Programming

    a.  [Using Data Abstraction in Lua](<Rational/Lua/Rational.html>)

    >   Example motivated by sections 2.1.1 and 2.1.2 from: 
	    Harold Abelson and Gerald J. Sussman with Julie Sussman. 
		[*Structure and Interpretation of Computer Programs*
		](<http://mitpress.mit.edu/sicp/>),
        Second Edition, MIT Press, 1996

    >   [SICP video lectures, Hal Abelson
        ](<https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/>)

    >   *Concepts*: designing modules with multiple implementations, data
	    abstraction barrier ("building the wall"), canonical forms,
	    using Lua modules, using higher order functions, using
	    closures/thunks to encapsulate data
		
    b.  [Rational arithmetic module](<Rational/Lua/rational.lua>)
        -- outer layer implementation of Rational Arithmetic abstraction 

    c.  [Rational number data representation using two-element arrays 
        ](<Rational/Lua/rationalCore.lua>)
        -- primitive layer implementation 1 \
		[[module]](<Rational/Lua/rationalCore.lua>) 
        [[test script]](<Rational/Lua/rationalCoreTest.lua>) 

    d.  [Rational number data representation using array but deferring GCD
        ](<Rational/Lua/rationalDeferGCD.lua>) -- 
        -- primitive layer implementation 2 \
		[[module]](<Rational/Lua/rationalDeferGCD.lua>) 
        [[test script]](<Rational/Lua/rationalDeferGCDTest.lua>) 
    
    e.  [Rational number data representation using closures
        ](<Rational/Lua/rationalClo.lua>)
	    -- primitive layer implementation 3 \
		[[module]](<Rational/Lua/rationalClo.lua>) 
        [[test script]](<Rational/Lua/rationalCloTest.lua>) 


@.  <a name="ComplexNumberLua"></a> 
    (for reference) Examine the complex number arithmetic modules in Lua 
	
    Modules are repeated in each package in which they are used

    a.  *Background* reading:
	    [*Structure and Interpretation of Computer Programs* 
	    ](<http://mitpress.mit.edu/sicp/>), Second Edition, MIT Press, 1996,
        Section 2.4

        [SICP video lectures, Hal Abelson
        ](<https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/>)

    #.  Rectangular coordinates modules: \
        [[arithmetic]](<Complex/Lua/complexRectangular.lua>) 
        [[rectangular representation]](<Complex/Lua/complexRectangularRep.lua>)
        [[utilities]](<Complex/Lua/complexUtilities.lua>)
        [[test driver]](<Complex/Lua/testComplexRectangular.lua>)

    #.  Polar coordinates modules: \	
        [[arithmetic]](<Complex/Lua/complexPolar.lua>) 
        [[polar representation]](<Complex/Lua/complexPolarRep.lua>)
        [[utilities]](<Complex/Lua/complexUtilities.lua>)
        [[test driver]](<Complex/Lua/testComplexPolar.lua>)

    #.  Tagged data modules: \	
        [[arithmetic]](<Complex/Lua/complexTagged.lua>)
        [[data tagging]](<Complex/Lua/dataTagging.lua>)
        [[utilities]](<Complex/Lua/complexUtilities.lua>)
        [[test driver]](<Complex/Lua/testComplexTagged.lua>)

    #.  Data-directed programming modules: \	
        [[arithmetic]](<Complex/Lua/complexDataDirected.lua>)
        [[rectangular  representation]](<Complex/Lua/complexRectangularRep.lua>)
        [[polar representation]](<Complex/Lua/complexPolarRep.lua>)
        [[data tagging]](<Complex/Lua/dataTagging.lua>)
        [[utilities]](<Complex/Lua/complexUtilities.lua>)
        [[test driver]](<Complex/Lua/testComplexDataDirected.lua>)

    #.  Object-oriented modules: \
	    [[arithmetic]](<Complex/Lua/complexObjOriented.lua>)
        [[utilities]](<Complex/Lua/complexUtilities.lua>)
        [[test driver]](<Complex/Lua/testComplexObjOriented.lua>)


@.  <a name="CellList"></a> 
    (for reference) Lua list module case study (Cell List)

    *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.)

    *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), Third Edition

	*Caveats*: (1) These modules (from 2013-14) internally layer the
     operations into primitive and non-primitive operations, but they
     do not separate the primitive operations into its own
     module. That can be done similarly to the Rational Arithmetic
     case study. (2) In the future, I plan to construct a more
     efficient implementation that uses array-style tables.  The
     table-based versions likely also need to use weak tables to avoid
     memory leaks.

    a.  Cell-based list module:\
        [[module source]](<CellLists/Lua/cellList.lua>)
        [[test driver]](<CellLists/Lua/cellListTest.lua>)

    #.  Closure-and-table-based list module variant:\
        [[module source]](<CellLists/Lua/cellListClosure.lua>)
        [[test driver]](<CellLists/Lua/cellListClosureTest.lua>)

    #.  Function-based cell list module variant:\
        [[module source]](<CellLists/Lua/cellListFunct.lua>)
        [[test driver]](<CellLists/Lua/cellListFunctTest.lua>)

    #.  Lazy list module variant using C preprocessor (cpp -P):\
        [[module source]](<CellLists/Lua/lazyList1.lua>)
        [[source after cpp]](<CellLists/Lua/lazyList1X.lua>) \
        [[test driver]](<CellLists/Lua/lazyList1Test.lua>)
        [[driver after cpp]](<CellLists/Lua/lazyList1TestX.lua>)
        [[sh script]](<CellLists/Lua/lazyList1run.sh>)

    #.  Lazy list module variant using
        [Lua Macro 2.5](<https://github.com/stevedonovan/LuaMacro>):\
	    [[macro  definitions]](<CellLists/Lua/lazyListMacros.lua>)
        [[module macro source]](<CellLists/Lua/lazyList2.luam>)
        [[source after luam -o]](<CellLists/Lua/lazyList2.lua>) \
        [[macro test driver]](<CellLists/Lua/lazyList2Test.luam>)
        [[driver after luam -o]](<CellLists/Lua/lazyList2Test.lua>)
        [[sh script]](<CellLists/Lua/lazyList2run.sh>)


@.  <a name="SICPch1"></a>
    (for reference) Examine functions adapted from SICP 

    a.  Background reading: Chapter 1 of the classic textbook 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](<http://mitpress.mit.edu/sicp/>)\]
		\[[HTML](<http://mitpress.mit.edu/sicp/full-text/book/book.html>)\]
		\[[SICP ebook site](<http://sicpebook.wordpress.com/>)
		
    #.  First-order functions in Scala

        -   [Square root (Newton's Method) with all public functions 
		    ](<SICP\_examples/Scala/sqrt.scala>)
        -   [Square root (Newton's Method) with nested function definitions 
		    ](<SICP\_examples/Scala/sqrt2.scala>)
        -   [Factorial
		    ](<SICP\_examples/Scala/factorial.scala>)
        -   [Fibonacci
		    ](<SICP\_examples/Scala/fibonacci.scala>)
        -   [Exponentiation
		    ](<SICP\_examples/Scala/exponentiation.scala>)
        -   [Greatest common divisor
		    ](<SICP\_examples/Scala/gcd.scala>)

    #.  Higher-order functions in Scala

        -   [Summation (takes function arguments)
		    ](<SICP\_examples/Scala/summation.scala>)
        -   [Derivative (returns function result)
		    ](<SICP\_examples/Scala/derivative.scala\>)

    #. Lua versions

	    -   [Square root (Newton's Method) 
		    ](<SICP\_examples/Lua/sqrt.lua>)
        -   [Factorial
		    ](<SICP\_examples/Lua/factorial.lua>)
        -   [Fibonacci
		    ](<SICP\_examples/Lua/fibonacci.lua>)
        -   [Exponentiation 
		    ](<SICP\_examples/Lua/exponentiation.lua>) 
        -   [Greatest common divisor
		    ](<SICP\_examples/Lua/gcd.lua>)
        -   [Summation
		    ](<SICP\_examples/Lua/summation.lua>)
        -   [Derivative
		    ](<SICP\_examples/Lua/derivative.lua>) 

    #.  Also various 
	    [Haskell](<SICP\_examples/Haskell/>), 
	    [Elixir](<SICP\_examples/Elixir/>), 
	    [Elm](<SICP\_examples/Elm/>), and
	    [Scheme](<SICP\_examples/Scheme/>)
		versions


@.  (for reference) Examine Square Root case study (stepwise refinement)
		 
     a.  [Using Stepwise Refinement in Lua 
	     ](<SICP_examples/Lua/StepwiseRefinement.html>) 

    >   *Concepts*:  TBD (examine the notes to see what was covered) 

    >    Example motivated by sections 1.1.7 and 1.1.8 from: 
	     Harold Abelson and Gerald J. Sussman with Julie Sussman. 
	     [*Structure and Interpretation of Computer Programs*
		 ](<http://mitpress.mit.edu/sicp/>),
         Second Edition, MIT Press, 1996 

    >   [SICP video lectures, Hal Abelson
        ](<https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/>)

    b.  [Square root](<SICP_examples/Lua/sqrt.lua>) 


## Programming Language Reference Materials

@.  [Free online programming language textbooks and tutorials 
    ](<Free\_Prog\_Lang\_Textbooks.html>) 


### Haskell

@.  [Learn X in Y Minutes, Where X = Haskell 
    ](<https://learnxinyminutes.com/docs/haskell/>)

@.  <a name="haskellnotes"></a> H. Conrad Cunningham.
    [Introduction to Functional Programming Using Haskell 
	](<https://john.cs.olemiss.edu/~hcc/csci450/notes/HaskellNotes/IntroFP\_Haskell.html>),
    Computer and Information Science, University of Mississippi,
    2016-2017.  (I am writing this "textbook" primarily for CSci 450
    and likely will use the title *Exploring Languages with
    Interpreters and Functional Programming* for the Fall 2018
    draft.)

@.  H. Conrad Cunningham.
    [*Notes on Functional Programming with Haskell* 
	](<haskell_notes.pdf>),
    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 *Exploring
    Languages with Interpreters and Functional Programming*. The
    chapters at the chapters at the end have not yet been
    integrated.)

@.  [Haskell language website](<http://www.haskell.org>)

     a.  [*Haskell 2010 Language Report*
        ](<http://www.haskell.org/onlinereport/haskell2010/>) 
     #.  [*GHC User's Guide*
        ](<http://www.haskell.org/ghc/docs/latest/html/users_guide/>) 

@.  [*Haskell Cheat Sheet*
    ](<http://cheatsheet.codeslower.com/CheatSheet.pdf>) 

@.  [School of Haskell](<https://www.fpcomplete.com/school>) 
    online tutorials

@.  Miron Lipovaca.
    [*Learn You a Haskell for Great Good: A Beginner's Guide* 
	](<http://learnyouahaskell.com/>),
    a free online tutorial at <http://learnyouahaskell.com/>.  (It is
    also in print from No Starch Press, 2011.)

@.  Kees Doets and Jan van Eijck.
    [*The Haskell Road to Logic, Math and Programming*
    ](<http://fldit\-www.cs.uni\-dortmund.de/~peter/PS07/HR.pdf>),
    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*
    ](<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>),
    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.

@.  Simon Marlowe. 
    [*Parallel and Concurrent Programming in Haskell: 
	Techniques for Multicore and Multithreaded Programming*
	](https://web.archive.org/web/20180117182938/http://chimera.labs.oreilly.com/books/1230000000929/index.html),
    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*](<http://book.realworldhaskell.org>),
	2008.
	This book is also available in print, published by O\'Reilly Media
    in November 2008.


### Lua

@.  [Learn X in Y Minutes, Where X = Lua 
    ](<https://learnxinyminutes.com/docs/lua/>)

@.  Definitive reference: Roberto Ierusalimshcy. *Programming in Lua*,
	Fourth Edition, Lua.org, Rio de Janiero, Brazil, 2016.  (The
	[First Edition ](<https://www.lua.org/pil/contents.html>) of this
	book, covering Lua 5.0, is available online at
	<https://www.lua.org/pil/contents.html>.)

@.  Instructor's <a href="LuaSlides">Lua slides</a> 
	(from CSci 450, Fall 2016)

    a.  Background: The slides below are adapted, in part, from
        [*Programming in Lua, Slides for Course* 
		](<http://www.dcc.ufrj.br/~fabiom/lua/>)
        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.
    #.  [Introduction to Lua ](<LuaIntro/01IntroLua.html>) 
	    slides based, in part, on Mascarenhas slide sets 0-5
	#.  [Advanced Lua Functions ](<LuaIntro/02IntroLua.html>) slides 
        based, in part, on Mascarenhas slide set 6 
	#.  [Modules in Lua ](<LuaIntro/03IntroLua.html>) slides 
        based, in part, on Mascarenhas slide set 9
	#.  [Lua Metatables ](<LuaIntro/04IntroLua.html>)
        slides based, in part, on Mascarenhas slide set 10
    #.  [Lua Objects ](<LuaIntro/05IntroLua.html>) slides based,
	    in part, on Mascarenhas slide set 11


### Python 3

@.  [Learn X in Y Minutes, Where X = Python3 
    ](<https://learnxinyminutes.com/docs/python3/>)

@.  Bernd Klein. [Python Course ](<https://www.python-course.eu>)


### Ruby

@.  [Learn X in Y Minutes, Where X = Ruby 
    ](<https://learnxinyminutes.com/docs/ruby/>)

@.  Chris Pine. [Learn to Program 
    ](<http://pine.fm/LearnToProgram/>)

@.  why the lucky stiff (Jonathan Gillette). 
    [why\'s (poignant) guide to Ruby
	](<http://mislav.uniqpath.com/poignant\-guide/>)


### Scala

@. [Learn X in Y Minutes, Where X = Scala 
   ](<https://learnxinyminutes.com/docs/scala/>) 

@.  Definitive reference:
    Martin Odersky, Lex Spoon, and Bill Venners. 
    *Programming in Scala*, Third Edition, Artima, 2016.
	The first edition (2008) is available online at
	<http://www.artima.com/pins1ed/>.

@.  Martin Odersky. [*Scala by Example* 
	](<http://www.scala-lang.org/docu/files/ScalaByExample.pdf>), 
	EPFL, 2014. \[[local](<localcopy/ScalaByExample.pdf>)\]

@.  Instructor's [Notes on Scala for Java Programmers 
	](<ScalaForJava/ScalaForJava.html>) 

@.  Paul Chiusano and Runar Bjarnason. 
    *Functional Programming in Scala*, Manning, 2015.

    a.  Instructor's Notes on 
		[Functional Data Structures (Chapter 3) 
		](<FPS03/FunctionalDS.html>)
    #.  Instructor's Notes on 
		[Error Handling without Exceptions (Chapter 4) 
		](<FPS04/ErrorHandling.html>) 
    #.  Instructor's Notes on 
		[Strictness and Laziness (Chapter 5) 
		](<FPS05/Laziness.html>)

