Skip to content

Meeting Notes: Development Environment Setup and Language Concepts

Quick Recap

The session focused on: - Setting up and configuring development environments for a computer science course, including SSH access to Beagle machines and Git setup. - Using Cloud Code for coding assistance, with a demonstration of implementing a scanner in both C and Rust. - Explaining scanning and tokenization using EBNF notation, and comparing C vs. Rust syntax and functionality. - Introducing the course mini-language, HDLANG, and emphasizing the importance of memory management and data structures. - Reviewing the lab assignment and available resources, including a Claude Code configuration file for personalized coding assistance.

Next Steps

For All Students

  • Complete SSH setup to Beagle machines:
  • Follow updated instructions in the lectures/dev environment section.
  • Configure SSH config and private key.
  • Test SSH and GitHub access.
  • Aim to finish today; seek help from Greg or Shreyas if needed.
  • Set up and test the Rust port of the autograder on Beagle machines:
  • Download the RISC-V binary release, untar it, and add it to the PATH as described on Campuswire.
  • Sign up for Cloud Code (if not already done) and install/configure it using the provided resources.
  • Review and work through the recommended Rust tutorial (Google Rust tutorial), with special attention to ownership.
  • Complete the current lab assignment:
  • Implement lexical scanners for NT-lang in both C and Rust using the provided starter code and resources.
  • Provide feedback to Greg and Shreyas on the effectiveness of in-person vs. online office hours after the initial schedule.

For Greg

  • Post the Cloud Code guide and the Claude Code configuration file (claude.md, with student mode settings) on the course website and Campuswire.
  • Share links to recommended Cloud Code course materials and news sources (e.g., Hacker News, Simon Willison’s blog).
  • Post additional resources and guides (e.g., a micro editor guide) upon student request.

For Shreyas

  • Hold office hours as scheduled; finalize and communicate the exact schedule to students.
  • Tentative: mostly in-person sessions, generally around midday (e.g., 12–3 PM), with some online days.
  • Note: A previous mention of daily 12–5 PM hours will be updated once the final schedule is confirmed.

Summary

SSH and Git Configuration Guide

  • Emphasis on direct SSH access to Beagle 5 machines using Stargate as a proxy.
  • Steps covered:
  • Configure SSH on local machines (include private key and username).
  • Test GitHub access using SSH.
  • Set up SSH for Git operations on Beagle machines to enable cloning GitHub repositories.
  • Students were encouraged to seek help during office hours if they encounter setup issues.

RISC-V Assembly Lab Setup

  • Beagle machines are useful for running and debugging RISC-V code, though not mandatory for initial labs.
  • Cloud Code does not support RISC-V; it should run on local machines.
  • The autograder setup was reviewed, with a recommendation to use the Rust port for faster performance.
  • Students should complete setup and reach out for assistance as needed.

Cloud Code Demo and TA Introduction

  • Cloud Code was demonstrated as a programming assistant:
  • Modes shown: immediate edit mode and plan mode.
  • Configuration via a claude.md file for Claude Code.
  • Example workflow: use Cloud Code to complete parts of a programming assignment, including suggestions and command execution.
  • Key point: Cloud Code can accelerate work, but understanding the underlying concepts is essential.
  • Shreyas, the new TA, was introduced; office hours will be held primarily in person, with details to be finalized.

Teaching Balance and Coding Tools

  • Instruction will be primarily in-person, with online availability as needed.
  • Claude was demonstrated for coding assistance:
  • Students are encouraged to leverage assistants effectively while still practicing independent problem-solving.
  • Concepts introduced:
  • Scanning and tokenization in compilers: converting text into tokens and then into machine code.
  • Flexibility to focus on either C or Rust based on student interest and background.

Understanding Tokens and EBNF Syntax

  • Tokens: groups of characters that simplify parsing and processing.
  • HDLANG: a mini-language supporting bit manipulation and basic operations on multiple numeric representations.
  • EBNF (Extended Backus–Naur Form):
  • Used to describe language syntax.
  • Examples of HDLANG token rules were discussed.
  • The class will work on implementing EBNF rules in code, translating grammar into logic.
  • EBNF supports recursion and can express structures beyond regular expressions, which is essential for parsing complex languages.

Understanding Tokens in LLMs

  • Tokens in LLMs are not rule-based; they are statistically learned representations.
  • Tokenization for LLMs is predefined before training; tokens map to vectors updated during training.
  • Basic command-line operations were reviewed (e.g., pwd, mkdir), along with the concept of an End of Transmission (EOT) token in the codebase.
  • A comprehensive Rust tutorial was recommended, with emphasis on ownership.

C Compilation and Preprocessing Overview

  • Overview of the C compilation pipeline:
  • Preprocessing, compilation, and linking to produce executable machine code.
  • Header files in C were compared to module imports in Python/Java:
  • They bring type signatures into scope so the compiler can generate correct code.
  • Useful tools:
  • The man command for library documentation.
  • Similarities between C and Rust were noted (e.g., main function, primitive types).

C vs. Rust Memory Management

  • C:
  • Local variables are allocated on the stack.
  • Manual memory management via malloc/free.
  • Rust:
  • Arrays can be stack-allocated; global data is more constrained.
  • Strong memory safety guarantees and concurrency support.
  • Ownership and borrowing replace manual malloc/free patterns.
  • Students were urged to understand where data lives in memory:
  • Pointers in C and ownership/borrowing in Rust.

C and Rust Pointer Basics

  • C pointers:
  • Pointer syntax, dereferencing, and mental models were covered.
  • Scanning tokens:
  • Implementation differences between C and Rust were highlighted.
  • Rust’s enums are more expressive and can associate methods with structs/enums, enabling concise designs.
  • Students were encouraged to experiment with the provided code and resources.
  • More Rust content will be covered in the next session.