Skip to content

Meeting Summary: CS 631-01 Systems Foundations

  • Date: Feb 19, 2026
  • Time: 08:05 AM Pacific (US and Canada)
  • Meeting ID: 870 0988 0761

Quick Recap

The session focused on NT-lang, a simple interpreter supporting both expression and script modes. Greg outlined: - Core features: variables, print statements, and basic arithmetic. - Evaluation via post-order traversal of the abstract syntax tree (AST), with environments used to resolve variables. - Differences between C and Rust implementations, including dereferencing and operator overflow handling in Rust. - A recommended phased approach: complete expression mode before implementing script mode.

Next Steps

  • Students:
  • Implement command-line parsing (e.g., -e, -b, -w, -u) and populate the config struct in both C and Rust.
  • Extend the scanner for script-mode tokens (e.g., IDENT, EQ, print as IDENT, NewLine).
  • Extend the grammar and parser for script mode: statements (assignment, print), variables, and multiple statements.
  • Implement an environment data structure (array of structs with name, value, isDefined) in both C and Rust, supporting lookup and upsert.
  • Extend eval in both C and Rust to handle identifiers (lookup), assignment, and print statements, with environment propagation.
  • Implement post-order evaluation for script-mode statements to ensure correct execution order and environment updates.
  • Finish expression mode (CLI options and evaluation) in both C and Rust before moving to script mode.
  • Start early and seek help from Greg or Shreyas as needed, as this project is more extensive than prior labs.

  • Instructor:

  • Greg will debug the issue in the solution code regarding multiple -b flags per the specification.

Summary

Language Processing Pipeline Development

The meeting centered on building a language pipeline: scanning, tokenization, parsing, and evaluation. The language now includes variables and print statements for both CLI expressions and script-based programs. Greg previewed a transition to RISC-V assembly next week, aiming toward a mini-compiler that can emit assembly or machine code, either offline or dynamically. The project serves as a unifying thread to compare legacy and modern systems languages.

Browser-Based AI Assistant Tools

Greg reviewed browser-based AI assistants (e.g., BrowserOS, OpenAI Atlas) and their integration with browsing workflows. He noted BrowserOS limitations in free mode and demonstrated usage with an API key or local models. He introduced pattern matching in Rust and discussed using such tools for automating site checks and rendering tasks. He also mentioned coding-assistant extensions (e.g., Claude, Florence) and that Brave supports Chrome extensions.

Rust Composite Values and Derive

Key Rust topics included: - Propagation of composite values by reference and explicit dereferencing. - Operator overflow behavior and type casting. - The derive macro system for auto-generating trait implementations for user-defined types.

AST Evaluation and Traversal Approach

Evaluation follows a post-order traversal: - Literals return values directly. - Operators evaluate children first, then apply the operator. - Introducing variables and multiple statements requires maintaining state via an environment mapping names to values. - Precedence rules are not enforced in Project One to keep scope manageable.

Programming Environments and Variable Resolution

An environment maps variable names to values and is threaded through evaluation. This approach mirrors strategies in languages like Lisp, Scheme, and Racket (prefix notation). NT-lang supports: - Binary mode - Simple expression mode - Script mode

Each mode offers different ways to compute and display results.

Number Base Expression Evaluation Tool

Greg demonstrated a tool for evaluating expressions across number bases: - Conversion among binary, decimal, and hexadecimal - Handling signed numbers with two’s complement - Script-mode usage, including base-specific printing with width controls

Script Mode Language Extension

Script mode requires: - Scanner changes to distinguish assignments and print (via token identifiers) - Grammar/parser changes for statements and multiple-statement programs - An environment structure (e.g., array of structs) for variable lookup and insertion

Upsert and Expression Parsing Overview

  • Upsert: insert a new variable or update an existing one; NT-lang uses a global scope.
  • Variables are added to and retrieved from the environment during execution.
  • Tokenization and parsing produce an AST for expressions and statements.
  • Print formatting reuses existing functionality.
  • Unresolved variables should produce clear errors.

Expression Trees Evaluation Demonstration

Greg demonstrated evaluation for expression and statement trees in both C and Rust: - Post-order evaluation for unary and binary operators - Parse tree structures for expressions and statements - Config structures for command-line options - Rust evaluation details, including wrapping behavior and casting

He emphasized mastering the evaluation process and starting early due to the project’s scope and the need to work fluently in both C and Rust.