Assignment 1: Read JCF

Due: January 27, 2026

For this assignment, you will translate your readjcf assignment from COMP 222/321 into Rust. The goal of this assignment is to get you familiar with Cargo, Rust syntax, and basic concepts such as ownership, borrowing, and lifetimes.

Translating Your Solution

You should start with your C solution from COMP 222/321 and translate it into Rust. The Rust version should have the same functionality as your original solution (was supposed to have). This assignment should not require any Rust libraries beyond the standard library.

You should run the same tests you were originally provided to test your code. We will provide an updated driver.pl file that adds "-t" and "-b" options to specify the test-cases directory and the binary to test. Your Rust solution should pass all of the test cases.

Logistics

You will find all of the materials for this assignment in the readjcf directory of the provided GitHub repository for the class. We will use this repository throughout the semester to provide materials for the assignments. You should clone this repository and pull updates regularly.

For your work on this assignment, you should create a new private GitHub repository in the class organization with the name readjcf-<netid> (where <netid> is replaced with your Rice NetID). The repository should contain your Rust solution, the provided testing infrastructure, and a README.md file that describes how to build, run, and test your code.

Code Review

To evaluate your solution, you will participate in a code review process during class. Given that you will all be implementing the same program, it does not make sense to go through a traditional code review process, as that will likely become extremely repetitive. Instead, we will divide you up into groups of 2 students each and split the process over two days.

Day 1: Presentations

On the first day, each pair will give a 15-minute presentation. The audience may ask clarifying questions, but detailed feedback is reserved for Day 2. Presentations should cover at least the following:

  1. How the code was produced (each member should briefly describe their process).
  2. Key differences between the two solutions.
  3. Details about constant-pool memory allocation and management, the representation of constant types, the representation of the JCF state, how the parsing was accomplished, and the error-handling strategy.
  4. Which aspects of each solution are stronger and why.

Your participation grade will reflect your portion of the presentation; split the time roughly evenly between group members.

You should take notes throughout the presentations to prepare for Day 2.

Day 2: Group Critique

On the second day, the class will critique and discuss all the solutions. Please review classmates' repositories on GitHub before class so discussion can focus on tradeoffs, best practices, and potential issues.