Visual Lambda Calculus
Visual Lambda is a graphical environment for exploring Lambda calculus using Bubble Notation. It represents lambda expressions as colorful 2D structures and animates beta-reduction steps smoothly, making complex logic easy to follow.
GitHub: https://github.com/bntre/visual-lambda
Demo
See Factorial 3 constructed and reduced to 6 in this dynamic video:
https://www.youtube.com/watch?v=aRgu8S3Pnb8
Bubble notation basics

Controls
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 keyboard reference, see controls.txt.
Puzzles
In the menu, select the puzzles workspace to try the Lambda Puzzles challenge. Your goal is to unlock each golden coin hidden inside a lambda term.
See the above GIF for a quick example of solving a puzzle.
Developer Console
Use the browser console to add items or manage your workspace:
> function vl(...args) { document.getElementById("game_drop").contentWindow.postMessage(args, "*") }
> vl('addItem', "MULT 2 (\\f x. f (f x))")
> vl('clearWorkspace')
> vl('saveWorkspace', "combinators3")
> vl('loadWorkspace', "combinators3")
Check the expression library for predefined terms.
Background
- Theory: Based on a master's thesis (2008). Read visual_lambda.pdf.
| Updated | 7 days ago |
| Status | Released |
| Platforms | HTML5 |
| Author | Torec Studio |
| Genre | Educational |
| Made with | pygame |
| Tags | lambda, lambda-calculus, Math, Minimalist, pygame, pygame-ce, pygbag, Visualization |
| Code license | GNU Lesser General Public License v3.0 (LGPL) |
| Average session | A few minutes |
| Inputs | Keyboard, Mouse |
| Links | Source code |
Development log
- Visual Lambda 2.2 (puzzles)8 days ago
- Visual Lambda 2.1 (pygbag 0.9.3)14 days ago


Comments
Log in with itch.io to leave a comment.
really cool! the circles are tricky to understand at first but once you start to get used to them it's cool to see them do their thing.
why is there no download button?
I thought the only geek who would want to download would go to github
ok