CSci 450-01: Org. of Programming Languages
CSci 503-01: Fund. Concepts in Languages
Lecture Notes, Fall 2018

Copyright (C) 2018, H. Conrad Cunningham

30 November 2018

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.

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

Lecture Notes

Go To Current Lecture!

Schedule, Notes, and Examples

  1. Textbook: Exploring Languages with Interpreters and Functional Programming
    [HTML] [PDF]

    Other free Haskell reference materials:

  2. (20 Aug) Discuss syllabus, class organization, and textbook

  3. Discuss Evolution of Programming Languages (Chapter 1):
    [HTML] [PDF]

    1. (22 Aug) Section 1.2, Evolving Computing Hardware Affects Programming Languages:
      [HTML slides]

    2. (22, 24 Aug) Section 1.3, History of Programming Languages:
      [HTML slides]

  4. Discuss Programming Paradigms (Chapter 2):
    [HTML] [PDF]

  5. Discuss First Haskell Programs (Chapter 4):
    [HTML] [PDF]

  6. (5 Sep) Discuss Assignment #1: [HTML] [PDF].

  7. Examine Haskell Types (Chapter 5) and programming basics:
    [HTML] [PDF]

  8. Discuss Procedural Abstraction (Chapter 6):
    [HTML] [PDF]

  9. Discuss Data Abstraction:
    [HTML] [PDF]

  10. Discuss Recursion Styles and Efficiency (Chapter 9):
    [HTML] [PDF]

  11. (19 Sep) Review for Examination #1

  12. (21 Sep) Give Examination #1 over ELIFP Chapters 1-2, 4-7, 9

  13. Discuss List Programming (Chapter 13):
    [HTML] [PDF]

  14. (26 Sep) Go over graded Examination #1

    See solution on the Blackboard site.

  15. (1 Oct) Distribute and discuss Assignment #2 (WWM Point-of-Purchase Project)

    1. Instructions: [HTML] [PDF]

    2. Project description: [HTML] [PDF] [CODE]

    3. See solution on the Blackboard site.

  16. Discuss Infix Operators and List Examples (Chapter 14):
    [HTML] [PDF]

  17. Discuss Higher-Order Functions (Chapter 15):
    [HTML] [PDF]

  18. (10 Oct) Demonstrate higher-order Haskell programming using exercises from Chapter 15.

  19. Discuss Haskell Function Concepts (Chapter 16):
    [HTML] [PDF]

  20. Discuss Higher-Order Function Examples (Chapter 17):
    [HTML] [PDF]

  21. Discuss More List Processing (Chapter 18):
    [HTML] [PDF]

  22. (22?? Oct) Distribute and discuss Assignment #3 (Carrie’s Candy Bowl)

    1. Instructions: [HTML] [PDF]

    2. Project description: [HTML] [PDF] [CODE]

    3. See solution on the Blackboard site.

  23. (22 Oct) Review for Exam #2

  24. (24 Oct) Give Examination #2 primarily covering ELIFP Chapters 13-18

  25. Discuss Algebraic Data Types (Chapter 21):
    [HTML] [PDF]

  26. (31 Oct) Return and discuss graded Examination #2

    See solution on the Blackboard site.

  27. Explore Overloading and Type Classes (Chapter 22):
    [HTML] [PDF]

    1. (2, 5 Nov) Overloading and Type Classes

    2. (for reference) Typeclassopedia by Brent Yorgey

    3. (5, 7 Nov) Movable Objects case study

  28. (7 Nov) Distribute and discuss Assignment #4, ExamDSL Project

    1. Instructions: [HTML] [PDF]

    2. Project description: [HTML] [PDF]

    3. Base Code: [ExamDSL_base.hs] [SimpleHTML.hs]

    4. See solution on the Blackboard site.

    5. (for reference) Domain-specific languages and similar Sandwich DSL case study

  29. Survey language processing concepts (Chapter 40):
    [HTML] [PDF]

  30. Explore the ELI Calculator language concrete syntax (Chapter 41):
    [HTML] [PDF]

  31. Explore the ELI Calculator language abstract syntax & evaluation (Chapter 42):
    [HTML] [PDF]

  32. Explore the ELI Calculator language modular structure (Chapter 43):
    [HTML] [PDF]

  33. (16 Nov) Give Examination #3 primarily covering ELIFP chapters 21-22 and 40-43

  34. (19-23 Nov) Enjoy Fall Break!

  35. (26 Nov) Discuss Assignment #5 (optional) — extending the ELI Calculator language interpreter:
    [HTML] [PDF]

    I posted this to the website and announced in email on 17 November.

  36. (26, 30? Nov) Explore the ELI Calculator language parsing (Chapter 44):
    [HTML] [PDF]

  37. (28 Nov) Return and discuss Examination #3

    See solution on the Blackboard site.

  38. (30 Nov) Review for Final Exam

    [HTML] [PDF]

  39. (5 Dec, 8:00-11:00 a.m.) Examination #4 (Final Exam) covering all work during semester

  40. (Not used 2018) Discuss Object-Based Paradigms (Chapter 3):
    [HTML] [PDF]

    Note: I covered this chapter in the Python-based CSci 556 Multiparadigm Programming class in Fall 2018.

  41. (Not used 2018) Study the Evaluation Model (Chapter 8):
    [HTML] [PDF]

  42. (Not used 2018) Discuss Software Testing Concepts (Chapter 11):
    [HTML] [PDF]

    Note: I covered this chapter in the Python-based CSci 556 Multiparadigm Programming class in Fall 2018. I paired it with a Python 3 example that used Pytest.

  43. (Not used 2018) Consider Testing Haskell Programs (Chapter 12):
    [HTML] [PDF]

    Note: I covered this chapter some in the Python-based CSci 556 Multiparadigm Programming class in Fall 2018.

  44. (Not used 2018) Revisit Data Abstraction (Chapter 23):
    [HTML] [PDF]

    Note: See Labelled Digraph Case Study below

  45. (Not used 2018) Explore Parser Combinators (Chapter 45):
    [HTML] [PDF]

  46. (Not used 2018) Explore the ELI Calculator language Compilation (Chapter 46):
    [HTML] [PDF]

  47. (Not used 2018) Examine the ELI Imperative Core language interpreter (future Chapter 47?)

    Code in work:

  48. (for reference) Notes on Scala for Java Programmers

  49. (for reference) Examine the Labeled Digraph case study

    Note: The Haskell version has been incorporated in ELIFP Chapter 23.

    1. Background (These notes have not been updated to use Haskell. Some material has also been incorporated into ELIFP chapters 6, 7, and 23.

    2. Haskell version (Spring 2015)

    3. Elixir version (Spring 2015)

    4. Scala versions (Spring 2016)

    5. Using the Elixir Digraph ADT module to build the Wizard’s Adventure game (Spring 2015)

  50. (Used 2016) Study Names, Scopes, and Bindings from Scott’s PLP textbook Chapter 3: slides

  51. (Used 2016) Study Subroutines and Control Abstractions from Scott’s PLP textbook Chapter 9: slides

  52. (Used 2016) Introduce Lua programming language

    1. Reference: Roberto Ierusalimshcy. Programming in Lua, Fourth Edition, Lua.org, Rio de Janiero, Brazil, 2016. The First Edition of this book is available online at https://www.lua.org/pil/contents.html; it covers Lua 5.0.

    2. Background: The slides below are adapted, in part, from 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.

    3. Introduction to Lua slides based, in part, on Mascarenhas slide sets 0-5

      Concepts: Lua design principles, REPL, chunk, script, data types and operators (e.g., nil, boolean, number, string, table, function), dynamic vs. static typing, first-class functions (first-class, anonymous, variadic, multiple return), statements (multiple assignment, if, while, repeat, numeric for, generic for, do), tables (as array, matrix, record, set)

    4. Advanced Lua Functions slides based, in part, on Mascarenhas slide set 6

      Concepts: lexical scope, higher-order functions, closure, callback, functional programming (map, filter, folds) Currying, partial application

    5. Modules in Lua slides based, in part, on Mascarenhas slide set 9

      Concepts: module, information hiding, interface, abstract interface, module and interface design criteria, Lua module implementation

    6. Lua Metatables slides based, in part, on Mascarenhas slide set 10

      Concepts: metatable; metamethod; Lua metatable & metamethod-related functions; shared metatable; overriding operation behavior; use of metamethods such as __add, __len, __eq, __lt, __le, __index, __newindex, and __tostring; proxy tables example

    7. Lua Objects slides based, in part, on Mascarenhas slide set 11

      Concepts: a simple Lua object model; Lua tables as objects; method; receiver object; colon method call operator; self; syntactic sugar; Lua classes as modules; using metatables and metamethod __index to construct classes and superclasses; constructor; class method; instance method; examples of classes and superclasses; instance-of;

References and Web Resources

General language

  1. Free online programming language textbooks and tutorials

  2. Harold Abelson and Gerald J. Sussman with Julie Sussman. Structure and Interpretation of Computer Programs, Second Edition, MIT Press, 1996. [HTML book]

    SICP video lectures, Hal Abelson

  3. William R. Cook. Anatomy of Programming Languages online draft

  4. Shiram Krishnamurthi. Programming Languages: Application and Interpretation, online book

Lua

  1. Lua language website

  2. Lua users site

    1. Lua Tutorial
  3. Fabio Mascarenhas. Programming in Lua, Slides for Course, Federal University of Rio de Janeiro, Brazil, July 2013. This course was delivered at Nankai University, P. R. China, in July 2013 using Lua 5.2.

  4. Roberto Ierusalimshcy. Programming in Lua, First Edition, Lua.org, Rio de Janiero, Brazil, 2003. This old edition at https://www.lua.org/pil/contents.html covers Lua 5.0.

  5. Luarocks component site

  6. Lua Toolbox

  7. Kepler Project

  8. Tecgraf PUC-Rio Libraries and Tools for Lua

  9. Penlight Lua Libraries inspired by the Python standard libraries

  10. LuaMacro site

  11. Love 2D game framework

Elm

  1. Elm language website

  2. Awesome Elm tutorial list

  3. An Introduction to Elm

  4. Elm Tutorial

Haskell

  1. Haskell language website

    1. Haskell 2010 Language Report

    2. GHC User’s Guide

  2. Haskell Cheat Sheet

  3. School of Haskell online tutorials

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

    Video lectures by Peter Drake

  5. H. Conrad Cunningham. Introduction to Functional Programming Using Haskell, Computer and Information Science, University of Mississippi, 2016 (partial draft), available from the prototype CSci 555 course site at http://www.cs.olemiss.edu/~hcc/csci555/prototype/. I begin developing this set of notes in June 2016 based partly on previous materials.

  6. H. Conrad Cunningham. Notes on Functional Programming with Haskell, Computer and Information Science, University of Mississippi, 1994-2014. This older document is being revised and integrated with other materials to produce the document Introduction to Functional Programming Using Haskell.

  7. Kees Doets and Jan van Eijck. The Haskell Road to Logic, Math and Programming, March 2004. This book is also available in print, published by College Publications, 2004.

  8. Paul Hudak. The Haskell School of Music: From Signals to Symphonies, Version 2.6, January 2014. This book is a recent rewrite of Hudak’s The Haskell School of Expression: Learning Functional Programming through Multimedia, Cambridge University Press, 2000.

  9. Simon Marlowe. Parallel and Concurrent Programming in Haskell: Techniques for Multicore and Multithreaded Programming,
    1. This book is also available in print, published by O’Reilly Media, 2013.
  10. Bryan O’Sullivan, Don Stewart, and John Goerzen. Real World Haskell,
    1. This book is also available in print, published by O’Reilly Media in November 2008.

Prolog

  1. SWI Prolog website

  2. Patrick Blackburn, Johan Bos, and Kristina Striegnitz. Learn Prolog Now. This a tutoral available online at http://www.learnprolognow.org/. It is also available in print from College Publications, 2006.