Systems / Programming Languages

Scheme Interpreter

A C implementation of a Scheme interpreter with tokenizing, parsing, evaluation, REPL support, custom allocation helpers, and language extensions.

Screenshots

Scheme Interpreter Code
Scheme Interpreter Code

Overview

Scheme Interpreter was built at Bethel University during my senior year for my Programming Languages class. It was a team project with three people, and the workload was split pretty evenly across the group as we worked through the classic language pipeline: tokenizing source text, parsing expressions, evaluating Scheme forms, and supporting an interactive REPL.

CSchemeInterpreterParserMemory Management

What I Built

Each teammate had an area where they really helped push the project forward. One teammate did exceptional work on the test files, another focused on the REPL, and I built the custom error management and helper functions that made it easier to detect errors and explain what went wrong. Those pieces mattered because interpreter bugs can otherwise be difficult to trace from the user's input back to the actual failure.

Technical Highlights

  • Tokenizes Scheme source into typed values for later parsing.
  • Parses list structure and expressions into interpreter-ready data.
  • Evaluates core forms, primitive functions, and user-defined behavior.
  • Supports a REPL interface for interactive experimentation.
  • Implements quote shorthand, load support, and if expressions without alternates.
  • Handles multi-expression bodies with last-expression return semantics.
  • Uses custom memory management and garbage-collection-style cleanup helpers.

What I Learned

This project made language implementation feel concrete. It connected data structures, parsing, evaluation, and memory management into one system, and it made clear how much good error messages matter when a program is helping someone understand why their code did not evaluate. It also gave me a better appreciation for team coordination on a codebase where almost every subsystem touches the others.

Future Improvements

One future goal is to continue this project with one of my teammates and bring the interpreter closer to the full R5RS Scheme specification. That would mean expanding the supported language features while keeping the REPL, tests, and error reporting strong enough to make the larger interpreter understandable.