reduction-lab

Every expression has a story. Watch it unfold.

Syntax Error 2026Shipped October 25, 2026#general
Repo
reduction-lab banner

About

## Challenges we ran into

**1. Preventing variable capture:** Naive substitution can change program meaning. We implemented capture-avoiding substitution using alpha-renaming to preserve semantics.

**2. Ensuring evaluator consistency:** We tested the independent small-step reducer and big-step evaluator against a hand-written corpus and 800 seeded random programs.

**3. Accurate visualisation:** We used AST node IDs, source spans, and reducer-generated metadata to highlight actual reduction steps instead of relying on scripted animations or text matching.

**4. Visualising `map` and `fold`:** Since the current expression alone cannot retain all list-processing context, we added step metadata and controller bookkeeping to track active elements and accumulator history.

**5. Handling runaway execution:** We introduced parser, tree-depth, evaluator, step-count, and expression-size limits, with explicit errors for exceeded limits.

## The problem it solves

Reduction Lab is an interactive, browser-based interpreter that makes the execution of functional programs visible, one reduction at a time.

Traditional REPLs show the final result but hide the intermediate computation. This makes it difficult to understand evaluation order, beta reduction, capture-avoiding substitution, and how higher-order functions such as `map` and `fold` transform lists.

Reduction Lab addresses this by rewriting expressions in place and highlighting the redex being reduced, the result of the previous step, and the list element or fold accumulator currently being processed. Users can step forward, revisit recorded states, inspect the syntax tree, and understand each reduction through a dedicated explanation panel.

Built for the Syntax Error 2026 Functional Programming Track, the project implements a small Haskell-like language supporting numbers, booleans, lists, functions, `let`, conditionals, operators, `map`, and `fold`. Every visualised state comes from the actual small-step reducer, while an independent big-step evaluator provides a reference for semantic consistency testing.

The result is a transparent, interactive way to explore how functional programs execute—not just what they return.

Team

From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

Duckling AI

Powerful AI coding assistant that automates heavy refactoring. Precise file search using similarity scores with embeddings.