CSCI-291: Programming Language Paradigms
Spring 2024
Contact Info
Covid:
As you're no doubt aware, variants of the Covid virus are still present in the surrounding area. It's highly transmissible, can be passed to (and by) those of us who are vaccinated, and can result in significant long-term illness even if you're vaccinated. Please take all possible precautions to avoid spreading Covid. Do not come to class if you're feeling sick or have had close contact with someone who is. Consider wearing a mask in class. All of my office hours will be held via Zoom, at least initially. (Our Zoom meeting room is 988 439 5089. Password and direct link are available on Canvas.)
Contents
Resources:
Our Zoom is 988 439 5089. Password (and direct link) available on Canvas.
Code and transcripts from class.
Other miscellaneous documents from class.
Haskell:
- Learn You a Haskell for Great Good!, our oddly named online Haskell tutorial.
- Real World Haskell, a free reference with an emphasis on useful applications of Haskell.
- haskell.org is the best site for all things Haskell.
- Leksah is a Haskell IDE written in Haskell. (Probably overkill for our purposes though.)
- GHC is the most widely used implementation. Download it and other useful tools here.
- Repl.it is a web-based platform that supports Haskell. Avoids hassle of installing GHC locally.
(Watch this video to see an example of how to get started.)
- Try Haskell is a web-based Haskell evaluator for simple expressions.
- Hoogle, a search engine for information on Haskell libraries.
- Here's the Haskell
language definition.
- A list of
tutorials, etc.
Logic Programming:
- The online Prolog tutorial we'll be using.
- Home page for SWI Prolog, the version on our systems. (Follow the links for Windows versions, etc.)
- There's an online browser-based version too.
- GNU Prolog is another free and widely-used implementation.
Schedule:
Week |
Topic |
Reading |
|
1/15 |
Intro to Haskell: Expressions, fn definitions, lists.
No class Monday |
Chapters 1, 2 |
Research Paul Graham. Read this,
and then this.
This article is worth reading too.
Assignment 1
(solns)
|
1/22 |
More on defining functions, lists; Types |
Chapters 3, 4 |
|
1/29 |
More on types and typeclasses, Recursion, Functions as values. |
Chapters 5, 6 |
Assignment 2
(solns) |
2/5 |
Applicative programming, Returning functions |
Chapter 6 |
Assignment 3
(solns) |
2/12 |
More on returning functions, Defining types |
Chapter 8 |
Assignment 4
(solns) |
2/19 |
More types, Larger examples |
Chapter 8 |
Assignment 5
(solns) |
2/26 |
Lazy Evaluation |
Lazy, Example
|
Assignment 6
(solns) |
3/4 |
Cyclic Programming, Managing state (monads) |
Chapter 12, other |
|
3/11 |
Spring Break |
3/18 |
More on managing state
Exam Wednesday in TH409 |
Chapter 12, other |
Study Guide, Old Exam, Old solns, New solns |
3/25 |
Prolog intro, Facts, Rules, and Queries |
Section 1 |
Assignment 7
|
4/1 |
Matching & binding, Proof Search
No class Monday |
Section 2 |
|
4/8 |
Recursion, Lists, Arithmetic |
Section 3, 4, 5 |
|
4/15 |
Terms, Cuts and Negation |
Section 9, 10 |
|
4/24 |
Collecting solutions
No class Friday |
Section 11 |
|
Background:
Declarative programming languages are an important alternative to languages (such as C, C++, and Java) that use the more familiar imperative programming paradigm. This course introduces the functional, dataflow, and logic programming paradigms in depth through assignments in the programming languages Haskell and Prolog. These languages are based on models of computation that are fundamentally different from the von Neumann model underlying imperative programming languages, and exposure to these new paradigms provides valuable perspective on programming and problem solving in general.
This course builds progressively on previously covered material.
Therefore, it is essential to attend all classes and keep
up with the reading and the assignments. Students are expected
to attend all lectures, with exceptions permitted in
case of illness and family emergencies, and should do the assigned
readings before each class.
Learning Objectives:
By the end of the semester, successful students should:
- Understand the distinction between the functional, logic, and imperative
programming paradigms
- Be aware of the range of possible type specification and type checking approaches
- Be familiar with lazy evaluation and understand both its strengths and its weaknesses
- Be able to write recursive functional programs
- Be able to write applicative-style functional programs
- Be able to write recursive logic programs
- Understand the difference between pure logic programming and Prolog
- Appreciate the benefits of expressing computations declaratively
Grading:
Homework for this class will be submitted electronically, and must be turned in by class time on the due date for full credit (unless the assignment explicitly states otherwise). Late homework will be penalized 5% per day, and will not be accepted more than one week late. The following grade cutoffs are upper bounds — they might come down, but will not be set higher: A = 95, A- = 90, B+ = 88, B = 83, B- = 80, C+ = 77, C = 73, C- = 70, D+ = 67, D = 64, D- = 60, F = <60.
Your overall grade is composed as follows:
- 60%: Programming Assignments
- 18%: Midterm Exam (Wednesday, March 20th)
- 22%: Final Exam (Monday, April 29th, noon-2:00pm in TH409)
Community Statement:
The course will work best if we respect and welcome each other no matter what level of "readiness" we are at, and we all support one another in learning. I will not tolerate behaviors that could negatively affect another student's classroom experience. Such behaviors might include: making rude or condescending comments, snickering at others' questions or comments, talking over other individuals, and so on. I reserve the right to withdraw a student from this class who is repeatedly exhibiting such behavior.
The goals of this course can only be accomplished in a setting of mutual respect, where ideas, questions, and misconceptions can be discussed with civility. As your instructor, I am committed to creating a classroom environment that welcomes all students, regardless of their identities (e.g., race, class, gender, sexual orientation, religious beliefs). I firmly believe that everyone in the class is fully capable of engaging and grasping the material, and that the world of computing is stronger when it includes the broadest possible set of perspectives. We all have unconscious biases, and I will try to continually examine my judgments, words, and actions to keep my biases in check and treat everyone fairly. I hope that you will do the same. If you feel comfortable, please let me know if there is anything I can do to make sure everyone is encouraged to succeed in this class.
Academic Integrity
The assignments form a crucial part of the course and, unless stated otherwise, students are required to work on them individually. Please ensure that any work you take credit for is your own. Inappropriate collaboration with other students is not permitted and will be subject to severe penalties. In particular, sharing your work in any way with other students (e.g. code inspection, sharing code electronically via email or photos, etc) is inappropriate, as is copying part or all of someone else's work. Code or other hints found online must be attributed, and should not compromise your ownership of the work.
Please review the university's Academic Integrity policy and ask me if you have any questions regarding its application to this course.
University, Academic, and Administrative Policies
There are many university policies and resources that offer guidance on how to be safe and make the most of your college education. Here are a few that you should take a moment to review:
- Please review university emergency preparedness, response procedures, and a training video posted at www.pugetsound.edu/emergency/.
- Protect yourself and others from COVID-19 by following our ongoing
campus safety protocols, posted here: https://www.pugetsound.edu/emergency/communicable-disease-outbreak-prevention/university-response-covid-19/protect-yourself.
- For information on academic and administrative policies (such as policies on grade policies, leaves of absence, declaring a major, academic integrity, and academic petitions) please refer to the academic and administrative policies section of the Bulletin.
- If you are seeking a religious accommodation in an academic course or program, please follow the process provided in the university’s policy on Student Religious Accommodations in Academic Courses or Programs, available at www.pugetsound.edu/office-university-counsel/policies/campuswide-policies/student-religious-accommodations-academic-courses-or-programs.
- If you have any concerns about prohibited harassment or discrimination that may be affecting you or others at Puget Sound, please contact the university’s Title IX Coordinator/Equal Opportunity Officer, Wheelock 218, 253.879.3793, website: www.pugetsound.edu/title-ix-equal-opportunity, email: titleix-eoo@pugetsound.edu. The Title IX Coordinator/Equal Opportunity Officer can explain available options and help address concerns informally or formally.
- If you have a physical, psychological, medical, or learning disability that may impact you as a student at Puget Sound, please contact Student Accessibility and Accommodation, Howarth 105, 253.879.3399, website: www.pugetsound.edu/saa, email: saa@pugetsound.edu. They will determine with you what accommodations are necessary and appropriate.