CSCI 316: Principles of Programming Languages
Course Information
Semester: Fall 2025
Section: M W 1:40 pm and 3:10 pm
Instructor: Dr. T. Yung Kong
Email: tkong@qc.cuny.edu
Office: SB A106
Office Hours: M W 4:45 – 5:20 pm in SB A106 and M W 7:50 – 8:15 pm in PH 113
Important documents and lecture slides will be posted in the Content section of the Brightspace site for this course.
About This Course
Students will complete an implementation of a small programming language (“TinyJ”) that is a subset of Java. This major programming project will involve reading and understanding code that is already written as well as writing code. It is to be done in Java, which students are assumed to have learned in an earlier course.
The project will provide a basis for concrete discussions of many aspects of programming languages, including:
- Expressions and their evaluation
- Structured statements and their execution
- Arrays and pointers
- Storage allocation (static, stack-dynamic, and heap-dynamic) for variables
- Function call and return
- Parameter passing
- Scope
- Virtual machines
In addition, this course will acquaint students with the functional programming paradigm (as an alternative to the procedural and object-oriented imperative paradigms that students will be familiar with from earlier courses). Students will learn to program in a functional style in the language Lisp.
Other topics relating to programming languages (e.g., programming language syntax) will also be covered, in class and/or by reading assignments.
Learning Goals
- To understand a variety of fundamental concepts relating to the design, specification, and implementation of programming languages.
- To become acquainted with the functional programming paradigm and the use of the programming language Lisp to solve problems in a functional style with frequent use of recursion.
Required Course Materials
Required Course Reader and Textbook
-
Course Reader – Sold by the Queens College Online Bookstore (https://qc.textbookx.com)
- Contains selections from: R. Sethi, Programming Languages, 2nd ed., Addison-Wesley, 1996.
- Important: Certain exam questions may assume you have a copy of this course reader that you can refer to during the exam. A legal copy of the course reader may be used during exams if its pages have no notes or markings, and nothing else is enclosed within its pages. Course readers that violate these conditions will be confiscated during exams. The exams will otherwise be closed book.
- On reserve in the Library—see https://qc-cuny.libguides.com/er.php?course_id=18376
-
Required Textbook – D. S. Touretzky, Common Lisp: A Gentle Introduction to Symbolic Computation, Dover, 2013. ISBN 978-0486498201.
- An electronic version is available online (to Queens College students) through the Library—see https://ebookcentral.proquest.com/lib/qc-ebooks/detail.action?pq-origsite=primo&docID=1920062
- Almost all of the content of an older edition is publicly available online—see https://www.cs.cmu.edu/~dst/LispBook/book.pdf
Recommended Textbooks
-
M. L. Scott, Programming Language Pragmatics, 4th ed., Morgan Kaufman, 2016.
- An older edition is available online (to Queens College students) through the Library—see https://ebookcentral.proquest.com/lib/qc-ebooks/detail.action?pq-origsite=primo&docID=649018
-
P. Seibel, Practical Common Lisp, Apress, 2012.
- Available online: https://dl.acm.org/doi/book/10.5555/2339396
- Full text also available: https://www.gigamonkeys.com/book/
-
R. Wilensky, Common LISPcraft, Norton, 1986.
-
P. Winston and B. Horn, Lisp, 3rd ed., Addison-Wesley, 1989 (reprinted with corrections, 1997).
Grading Policy
Grades will be a measure of attainment (not effort). Your grade will be based on your scores on the cumulative Final Exam, two other exams, one for-credit homework assignment (Lisp Assignment 1), and seven for-credit programming assignments (the last three of which will constitute the TinyJ implementation project). Some exam questions will relate to programming assignments.
Maximum Possible Scores
Exam 1: 25 points
Exam 2: 25 points
Cumulative Final Exam: 40 points
For-Credit Lisp Assignments: 1.5 + 0.4 + 0.6 + 1.5 + 1.5 = 5.5 points
TinyJ Implementation Assignments: 1.5 + 1.5 + 1.5 = 4.5 points
Grade Calculation
When considering your scores for grading purposes, I will first replace the lower of the scores on Exam 1 and Exam 2 with (Final Exam score × 25/40) if the latter is higher. (If your scores on Exams 1 and 2 are equal, at most one of those scores can be replaced in this way.)
Let:
- a = sum of your scores on exams and for-credit assignments
- b = (sum of your exam scores) × 100/90
Your grade will be computed from the values of a and b using rules A and B below. If the rules give different grades, you will receive the higher of those two grades. (Note that no grades of C− will be given.)
Rule A
You will be considered to be an A-range student if the following are both true:
- a ≥ 87
- You scored higher than at least 70% of the class on the cumulative final exam.
The A-range grades are A+, A, and A–.
Provisional threshold scores for these grades are:
- A+ 97
- A 90
- A– 87
If you are an A-range student, you will receive the highest A-range grade for which a is ≥ that grade’s threshold score.
Provisional threshold scores for the grades between C+ and B+ are:
- C+ 73
- B− 77
- B 80
- B+ 83
If you are not an A-range student and a is ≥ the threshold score for C+, then you will receive the highest of the grades C+, B−, B, and B+ for which a is ≥ that grade’s threshold score.
If a is < the threshold score for C+, then your grade will be C if at least one of the following is true:
- (i) You scored higher than at least 35% of the class on the cumulative final exam.
- (ii) a ≥ 69. (The threshold of 69 may be lowered by up to 1 point for some students, at my discretion.)
If neither (i) nor (ii) applies to you but a ≥ 60 and you are an undergraduate who has not asked to be excluded from consideration for D+ and D grades, then your grade will be D+ if a ≥ 63 and D if 60 ≤ a < 63. In other cases where neither (i) nor (ii) applies, your grade will be F unless you have withdrawn from the course or are absent from the final exam. (Students who have not withdrawn but are absent from the final exam without my permission may be given a grade of WU.)
Rule B
No grades of A+ will be awarded on the basis of this rule. Otherwise, rule B is the same as rule A except that b is used in place of a, threshold scores for grades might be a little lower, and the definition of “A-range student” might be a little broader.
Make-up Exams
There will be no make-ups for Exams 1 and 2: Missing either exam will be equivalent to scoring 0 on that exam, but the 0 will be replaced by (your Final Exam score × 25/40) if you miss just one exam.
For illustrative grading examples, see the Grading-Policy-Examples document in the Course Documents section of Brightspace.
Assignments and Late Submission Policy
Assignment Collaboration
Lisp Assignments 1 and 2 must be done individually. You may work either on your own or with up to two other students on the rest of the for-credit assignments. However, when two or three students work together on an assignment, each student must write up his/her own submission (which needs to clearly state the name(s) of his/her partner(s)) independently, and is expected to fully understand all parts of the submission. No two students may make submissions that are essentially the same.
Assignment Submission Locations
- Lisp Assignment 1: Must be submitted on Brightspace
- Lisp Assignments 2–5 and TinyJ Assignments 1–3: Must be submitted on the school ssh server
mars.cs.qc.cuny.edu
You have been given a new mars account for this purpose. Note: This account is not the same as any mars account you may have used in other courses. Detailed instructions for submitting each for-credit assignment will be provided in the corresponding assignment document. Submissions sent to me by e-mail will not be graded!
Local Development
Lisp Assignments 2–5 and TinyJ Assignments 1–3 can be done on mars. You can write code for Lisp Assignments 2–5 on your own PC or Mac if you wish, provided that you can install the Clisp implementation of Common Lisp on that computer—instructions are given at the end of the “Preliminary Exercises to Familiarize Students with Lisp” document.
Similarly, you can do TinyJ Assignments 1–3 on your own PC or Mac if you have installed or can install the Java SE JDK on that computer—instructions will be given in the TinyJ Assignment 1 document.
If you choose to do one or more of Lisp Assignments 2–5 and TinyJ Assignments 1–3 on your PC or Mac instead of mars, then when you are ready to submit, you will be expected to use an scp or sftp client to copy the .lsp or .java file(s) you are submitting to mars.
Example: To copy the file myfile.lsp from your current working directory on a PC or a Mac into your home directory on mars, enter:
scp myfile.lsp xxxxx_yyyy316@mars.cs.qc.cuny.edu:
Here xxxxx_yyyy316 means the username of the mars account that has been created for you to use in this course. Note that .edu is followed by a colon in this command!
Assignment Due Dates
Preliminary due dates of the for-credit assignments are given below. The actual due date of each of these assignments will be announced in the document that gives details of the assignment (which will be provided to you at least one week before the due date).
| Assignment | Date |
|---|---|
| Lisp Assignment 1 | October 8 |
| Lisp Assignment 2 | October 10 |
| Lisp Assignment 3 | October 21 |
| Lisp Assignment 4 | October 30 |
| Lisp Assignment 5 | November 11 |
| TinyJ Assignment 1 | December 3 |
| TinyJ Assignment 2 | December 11 |
| TinyJ Assignment 3 | December 23 |
Late Submissions
Late / corrected submissions of any assignment may be made until a late-submission deadline that will be announced in December but will not be before your final exam. Late submissions may incur a penalty as explained below. Assignments will not be graded until after the late-submission deadline.
If when I compute a student’s course grade I see that the number of assignments submitted late is ≥ 4, the student is subject to a penalty of N − 3 points, where N is the number of assignments submitted late. There is no penalty if N < 4.
Checking Submission Status
For Lisp Assignments 2–5 and TinyJ Assignments 1–3, if you are not sure that the files containing your submissions can be found by me for grading purposes or you are unsure whether a submission was late, you can check by logging in to your mars account for this course and entering one or more of the following commands:
ls -lLc submitted-Lisp-assignments # For Lisp Assignments 2–5
ls -lLc submitted-TinyJ-assignments/TJ1asn/Parser.java # For TinyJ Assignment 1
ls -lLc submitted-TinyJ-assignments/TJasn/ParserAndTranslator.java # For TinyJ Assignment 2
ls -lLc submitted-TinyJ-assignments/TJasn/virtualMachine # For TinyJ Assignment 3
These commands show the “last status change times” (or ctimes) of submitted files. If the response to one of these commands is “total 0” or a message that ends with “No such file or directory”, then no submission was found by the command! If the ctime of a submitted file is after the assignment’s due date, then you will be considered to have made a late submission of the corresponding assignment.
Note: You will be considered to have made a late submission of TinyJ Assignment 3 if the ctime of any one of the files you submitted for that assignment is after the assignment’s due date.
Academic Integrity
Academic Misconduct and Plagiarism
Students found to have provided their answers to others during an exam or to have submitted work of others as their own will receive a grade of F for the course.
Important Note on Assignments
Although the for-credit assignments will not count more than 10% towards your grade, and other homework exercises will not carry any credit, you should not underestimate the importance of doing this work. When you are given any homework (e.g., a reading assignment), assume that the work is to be done before the next exam unless some other deadline is indicated. Exam questions that are similar or related to for-credit and not-for-credit assignments or other homework exercises will count at least 35% towards your grade.
Attendance
Students are expected to attend all classes. Students who are absent from part or all of a class are responsible for catching up and must not expect me to assist them in doing that.
Preliminary Course Schedule
Note: This schedule is preliminary and subject to change. However, any change in the date of an exam will be announced at least one week before the new date.
1 8/27 W Information about the course.
9/01 M No class.
2 9/03 W Functional programming.
3 9/08 M Functional programming (contd.). Lisp: Introduction.
4 9/10 W Functional programming (contd.).
5 9/15 M Lisp: S-expressions—atoms & lists.
6 9/17 W Lisp: Defining your own functions.
9/22 M No class.
9/24 W No class.
7 9/29 M Lisp: QUOTE. Built-in functions for working with lists.
10/01 W No class.
8 10/06 M Lisp: C…R functions; CONS cells; built-in predicates.
9 10/08 W Lisp: Built-in predicates (contd.).
10/13 M No class.
10 10/14 Tu (M sched.) Lisp: COND & IF; AND & OR. LET/LET*.
11 10/15 W Lisp: LET/LET* (contd.). Writing recursive functions.
10/20 M No class.
12 10/22 W Lisp: Recursion (contd.).
13 10/24 F (M sched.) Lisp: Recursion (contd.).
14 10/27 M Lisp: Recursion (contd.).
15–16 10/29 W & 11/03 M Lisp: Recursion (contd.). Functions that take
functions as arguments, MAPCAR, REMOVE-IF, REMOVE-IF-NOT, LAMBDA,
FUNCALL, APPLY.
17 11/05 W Tail recursion. Syntax of programming languages: Expression
notations.
18–19 11/10 M & 11/12 W Syntax of programming languages (contd.).
20 11/17 M Probable date of Exam 1.
21 11/19 W Syntax of programming languages (contd.).
22–23 11/24 M & 11/26 W TinyJ Assignment 1; recursive descent parsing.
23–26 11/26 W - 12/08 M TinyJ Assignment 2; memory allocation;
hand-translation of TinyJ source into TinyJ VM code;
compiling statements, expressions, and methods into VM code.
26–27 12/08 M & 12/10 W TinyJ Assignment 3; execution of TinyJ VM code.
Parameter passing modes.
28 12/15 M Probable date of Exam 2.
2-Hour Cumulative Final Exam:
1:40 section: Wednesday, 12/17, 1:45 – 3:45 pm
3:10 section: Monday, 12/22, 1:45 – 3:45 pm
All exams will be given in our regular classroom unless a room-change is announced.
VPN Access Information
How to Connect to the QC VPN
Essential Information for Off-Campus Remote Use of CS Dept. Computers
Important: You will only be able to connect to the QC VPN after you have set up CUNY login multi-factor authentication (MFA) and then installed the GlobalProtect VPN client app on your PC or Mac.
The following documents provide instructions for doing that:
Important notes:
- If the GlobalProtect app was installed on your computer before you set up CUNY login MFA, then the GlobalProtect installation instructions tell you to first uninstall the installed GlobalProtect app, then download an appropriate installer for the latest version of the app, and then run the installer.
- If you are installing the GlobalProtect app on a Windows PC, the instructions tell you to run the GlobalProtect installer from a command line using the msiexec command with the defaultbrowser=yes option.
Using GlobalProtect
To connect to the QC VPN after setting up CUNY login MFA and installing the GlobalProtect app:
- Open the GlobalProtect app
- Click on “Get Started”
- Type
gpvpn.qc.cuny.eduin the Portal textbox - Click the “Connect” button
Note: You only have to click on “Get Started” and type gpvpn.qc.cuny.edu in the Portal textbox the first time you use GlobalProtect to connect to the QC VPN. After that, you should be able to connect to the VPN simply by opening the GlobalProtect app and clicking its “Connect” button.
Mars Accounts
Account Information
You have a new Linux account on the machine mars (also called venus) for use in this course.
Important: Many of you will have used another mars account, with a different username, in a previous class. Do not confuse your mars account for this course with any other mars account you may have used!
Username Format
The username of your mars account for this course is xxxxx_yyyy316, where:
- xxxxx = your last name in lowercase if it has ≤ 5 letters (omit any space or hyphen in the name)
- xxxxx = first 5 letters of your last name in lowercase if it has > 5 letters
- yyyy = your first name (as shown on the attendance sheet) in lowercase if it has ≤ 4 letters
- yyyy = first 4 letters of your first name in lowercase if it has > 4 letters
Examples:
- David Touretzky →
toure_davi316 - Ada Lovelace →
lovel_ada316 - Ravi Sethi →
sethi_ravi316
Initial Password
The initial password of your mars account for this course is q followed by the last 7 digits of your CUNYfirst ID.
Example: If your CUNYfirst ID is 12345678, then q2345678 is the account’s initial password.
However, you will have to change your password the first time you logon to the account!
Logging On to Mars
You can log on to mars from a Windows PC or a Mac by following the instructions below while you are connected to the QC VPN or (if you are at Queens College) while you are signed-in to the qwifi-secured wireless network.
From Windows (PowerShell):
ssh your_username@mars.cs.qc.cuny.edu
From Mac (Terminal):
ssh your_username@mars.cs.qc.cuny.edu
Note: The first time you use the ssh command on a particular PC or Mac to connect to mars, you will be prompted to “Type yes to continue connecting.” This step applies only the first time; it doesn’t apply if you’ve previously used the ssh command on the same PC or Mac to connect to mars.
Special Note: The first time you enter the command on your PC or Mac this semester, you might be warned that “REMOTE HOST IDENTIFICATION HAS CHANGED!” In that case, enter the command:
ssh-keygen -R mars.cs.qc.cuny.edu
and retry.
First Login Requirements
Log on to this account no later than our 3rd class meeting: If you can’t logon, ask for help from Xiuyi Huang in SB A208 or the CS virtual office (see https://www.cs.qc.cuny.edu/), or send email to Xiuyi (xhuang@qc.cuny.edu) to ask for help.
Changing Your Password
As mentioned above, you will have to change your password the first time you logon to the account:
Changing password for ?????_????316.
Current password: Do NOT enter your new password at this prompt. Instead, enter q followed by the last 7 digits of your CUNYfirst ID one more time. Then you will be prompted to enter a new password and to re-enter that new password for verification. Assuming you re-enter your new password correctly, your password will be changed and you will immediately be logged off.
Setup Script
Log on to the account again (using your new password!) and enter the following at the xxxxx_yyyy316@mars:~$ prompt:
source /home/faculty/ykong/316setup
Extra Credit Opportunity
If you do the above no later than Thursday, September 11, then you will receive 0.25 pt. extra credit (and you should see a message that confirms this after you enter the source /home/faculty/ykong/316setup command).
Such extra credit will be awarded by substituting a+0.25 and b+0.25 for a and b in grading rules A and B.