CS 4414/5416:
Systems Programming

Lab 1: Counter Statistics

2026-08-28

Welcome!

TODO: TAs introduce yourselves

Lab Logistics

Primary goal: Work together on something

  • Fine to have small groups (up to 4)
  • Grab a question sheet per person (as in lecture)
  • Work on the lab assignment during the hour

A quick technical note

#[derive(PartialEq, Eq)]
struct MyStruct {
    // Fields go here
}
  • The derive macro automatically implements code for the Eq and PartialEq traits.
  • We’ll discuss traits and derive in more detail soon

A quick technical note

#[cfg(pred)]
struct MyStruct {
    // Fields go here
}
  • The cfg macro allows for conditionally including code.
  • When pred is true, code is included, when it is false it is excluded.
  • Kind of like #ifdef macros in C.

Getting the material

Repo: https://github.coecis.cornell.edu/cs4414-f26/lab-01

  • Go to ASSIGNMENT.md for assignment details.
  • Your code should go in lib.rs
  • Check progress with cargo test (see Milestones header)

Hand in question sheet at the end of session

  • Who were you working with?
  • How far did you get by the end?
  • What questions came up?