The project was migrated from https://code.google.com/archive/p/visual-lambda/ and from https://bitbucket.org/bntr/visual-lambda.
Visual Lambda is a graphical environment and visual programming tool
for exploring untyped lambda calculus using Bubble Notation.
It represents lambda expressions as colorful, tree-like 2D structures
and animates beta-reduction smoothly, making reductions easy to follow.
The project started as a master's thesis (2008); see the thesis for details: visual_lambda.pdf.
This might be useful for students, educators and researchers who want an intuitive, interactive way to explore λ‑calculus and reduction strategies.
Try it live: https://bntre.github.io/visual-lambda/
Lambda puzzles challenge: https://bntre.github.io/visual-lambda/#workspace=puzzles
Or alternatively: https://bntr.itch.io/visual-lambda
Watch a short demo to get an idea of how Bubble Notation works:
https://www.youtube.com/watch?v=aRgu8S3Pnb8
Other video examples:
- Pairs, construction and reduction: https://www.youtube.com/watch?v=YEyyyzUuUJQ
- Predecessors: https://www.youtube.com/watch?v=CWzn2ucPMdg
- Recursion: https://www.youtube.com/watch?v=bGG9exO2kew
Old GIF examples:
- 'MULT 3 2' evaluation: MULT_3_2_=_6.gif
- 'Y I' evaluation: Y_I.gif
Dependencies
- Python 3.8+
- pygame-ce 2.5.6
pip install pygame-ce==2.5.6
python main.py
The workspace contains lambda terms and text labels. You can drag any of them with the mouse.
The last touched term becomes selected. Selected subterms are highlighted with a red outline.
You can modify a whole term or any selected subterm using the right toolbar.
Hover over buttons to see tooltips and keyboard shortcuts.
Use the Play button at the bottom to perform a beta-reduction step.
Each term keeps its own reduction history, so you can undo and redo steps.
To create an application, drag one term onto another subterm (the target area is highlighted in dark red).
Note: the dropped term loses its reduction history - make a copy first if you want to preserve it.
Lambda mode and reduction strategy can be changed in the left menu.
For the full list of keyboard shortcuts and detailed controls, see controls.txt.
The repository includes a small library of predefined expressions that you can paste into the console: see library.txt.
Visual Lambda also includes a small interactive challenge:
Lambda Puzzles https://bntre.github.io/visual-lambda/#workspace=puzzles
The puzzle set contains several tasks in Bubble Notation with gradually increasing difficulty.
In each puzzle, a golden coin (represented as a yellow free variable) is hidden inside a lambda term.
Your goal is to construct another term (a "key") and apply it in such a way that, after full beta-reduction, only the coin remains.
Solving_a_puzzle.mp4
- Programming with Visual Expressions, Wayne Citrin
- A Graphical Notation for the Lambda Calculus, Dave Keenan
- Alligator Eggs, Bret Victor (browser game)
- More in Prathyvsh's catalog
I still think Bubble Notation is a promising way to represent lambda terms, but this implementation is a bit dated.
A modern reimplementation could improve interaction and visuals.
Possible directions:
- Make terms feel more "springy" and react to dragging with natural, physics-like motion.
- Revisit the lazy-evaluation visualization to make it clearer and more robust.
- Visual Lambda is licensed under the GNU Lesser General Public License v3.0.
- This project also includes Open Sans, licensed under the SIL Open Font License 1.1.


