Homework 13
Last updated: Fri, 8 May 2026 10:28:40 -0400
Out: Thu May 07 2026, 11am EST
Due: Thu May 14 2026, 11am EST
Overview
In this assignment, you will get a chance to use the "450lang" high-level language that you have created this semester!
This hw will be graded accordingly:
correctness (Autograded) (?? pts)
design recipe (?? pts)
testing (?? pts)
style (?? pts)
README (?? pts)
Setup
Create a new repository for this assignment by going to the CS450 Spring 2026 GitHub Organization and clicking "New".
Note: The CS450 Spring 2026 GitHub Organization must be the owner of the repository. Please do not create the repository in your own account.
On the "Create a new repository" screen:
Name the repository hw<X>-<LASTNAME>-<FIRSTNAME> where <X> is the current homework number.
For example, I would name my hw13 repository hw13-Chang-Stephen.
Mark the repository as Private.
Check "Add a README file".
Select the Racket template for the .gitignore.
Choose whatever you wish for the license.
When done click "Create repository".
Updating Racket450
Make sure you have the latest version of racket450.
To do this from DrRacket, go to File -> Package Manager -> Currently Installed, search for "racket450", and then click "Update".
Alternatively, if you prefer the command line, run:
raco pkg update racket450
NEW!
Installing 450Lang
In this assignment, we will use our "450 lang" programming language, so we must install it first.
The easiest way to do so is from DrRacket, go to File -> Package Manager, and then install the 450lang package. This will allow you to use the language by writing #lang 450lang at the top of a file.
(If you installed it before this hw, make sure to update the package, also via DrRacket Pacakge Manager, to get the latest changes.)
Tasks
Programming
(New) In this assignment, you must use the "450lang" programming language. See the specification for the programming language. In addition to what you implemented in previous assignments, there are additional features that have been added such as lists and other primitives.
For this assignment, all code—
However, all submitted code must still follow the The Design Recipe. This means that language features may only be used in the correct scenarios, as called for by The Design Recipe, though these rules may be relaxed for language features that are unavailable (i.e., no define/contract, cond).
Signatures should be in comments since we don’t have define/contract
For Examples and Tests, use the 450lang built-in testing forms (see the testing part of the language specification).
All functions should still have at minimum one Example and "sufficient" Tests.
Examples and Tests for a function definition should be put before after the bind/rec in hw13.rkt.
So long as you cite it properly, you may use any sources (including AI companion tools) to help you clarify or understand the problem.
Important: Each submission must be organized so that each function only processes one kind of data. Submissions consisting of only a few large, unreadable functions that try to do everything will not receive any credit.
Very Important: Since 450lang is a basic language that does not have the niceties, i.e., debugging info, of industrial-strength languages, it will be especially important to program incrementally, following the design recipe. Make sure that each line of code is tested and that everything "works" before adding another line of code. If you don’t follow a proper programming process, the program will become impossible to debug and you will have to start over. If you come to the course staff with a pile of non-working code, we won’t be able to figure it out either, and we will only be able to give you this same message
Programming
A programming language is called "self-hosted" if it can be used to implement itself. In this assignment, you will use the 450Lang language you have created to do this!
Specifically, use 450Lang to implement a run function that implements another new language, called "450LangLang" (we will use this "double" naming convention for names in the new language, to try to keep the different language names distinct)
Program Data Definitions
For each of these data definitions, you should complete them by writing the necessary predicates, constructors, etc.
- An ASTAST is one of:
(Racket) Integer
BoolBool
(li "++" ASTAST ASTAST)
(li "zz?" ASTAST)
(li "||" ASTAST ASTAST)
(li "ifif" ASTAST ASTAST ASTAST)
Represents: an abstract syntax tree data structure for the new "450LangLang" language. Since 450Lang has no structs, we have to implement our own using lists that have a "tag" (equivalent to the struct name) as the first element (the actual implementation of struct is not that different from this!) A BoolBool is either "tt" or "ff"
Represents: true or false, respectively
- A ResultResult is one of:
(Racket) Integer
(450Lang) TRUE!
(450Lang) FALSE!
"ERRERR"
run : takes an ASTAST and produces a ResultResult
"++" should perform addition on integers. Anything else should result in "ERRERR"
"zz?" should evaluate to TRUE! when the input is evaluates to zero and FALSE! for everything else, except for errors should propagate
"||" is short-circuiting OR. It should evaluate to TRUE! if one of its arguments is tt evaluates to TRUE! and FALSE! otherwise
"ifif" is a conditional that evaluates the first branch if the test is evaluates to TRUE!, otherwise evaluates the second branch, with the exception that if the test is "ERRERR" then the result should be "ERRERR" and neither branch should be evaluated.
An error result in an "inner" program should propagate to be the final result, as we’ve been doing in previous assignments
Before Submitting
Testing (and Autograders)
Before submitting, note:
Each programmer is solely responsible for testing their program to make sure it’s correct. Do not submit until all code has been has a "sufficient" number of Test cases that verify its correctness.
Note that there is no GradeScope "Autograder" available for students to use (an Autograder is not a software development/testing tool anyways, so it should not be used as one).
Thus, no questions mentioning an Autograder will be answered, e.g., posts asking "why is the Autograder giving an error?" are not allowed.
If you happen to find an Autograder and decide to look at its output despite this warning, please understand that it may be incorrect or incomplete, change at any time, or have random behavior, and that it in no way indicates the grade of the submitted hw.
Anyone that does get useful information from an Autograder, e.g., a failing test case or crashing code report, should treat it as bonus information (that you otherwise would not have had) that you and you alone must determine what to do with.
Regardless of what any Autograder might say, all code must still be independently tested to be correct before it is submitted.
The proper way to ask questions is with small code examples. This means that each question must include a small example code snippet along with what the "expected" result should be!
Further, any posted examples should contain the minimal amount of code needed to explain the question. Full file dumps or anything more than a few lines will not be accepted. More is not better. In fact it’s worse because it takes longer to read and is less likely to get a good answer.
Style
All code should follow proper Racket Style.
Also, the repository itself must follow proper style. Specifically, it must have appropriate commit messages. See How to Write a Git Commit Message if you are unsure how to write a commit message.
Note: Do not use the "file upload" feature on Github. The course staff may not accept hw uploaded in this way.
Files
A submission must have the following files in the repository root:
hw13.rkt: Contains the hw solution code.
The first line should be #lang 450lang.
All bind/rec definitions should use the name specified in the exercise (ask if you are unsure).
README.md: Contains the required README information, including the GitHub repo url.
When you are done, submit your work to Gradescope hw13. You must use the "GitHub" Submission Method and select your hw<X>-<LASTNAME>-<FIRSTNAME> repository.
Note that this is the only acceptable way to submit homework in this course. (Do not manually upload files and do not email files to the course staff. Homework submitted via any unapproved methods will not be graded.)

