An interactive lambda calculus playground built with JavaScript. Try it live here.
This is a learning project to understand lambda calculus through implementation. The interpreter supports:
- Basic lambda calculus syntax
- Function abstraction and application
- Variable substitution
- Beta reduction
- Church numerals
I was reading Haskell Book and wanted to implement the interpreter. I will document my journey once the interpreter is complete.
If you are looking to work on the interpreter, you can run the following commands:
npm install
npm test
If you are planning to work on the cli/playground, you can run the following commands:
npm run dev
- Pass all interpreter tests | 3 pending
- Add a linter
- Error Handling
- Better error messages for syntax errors
- Visual indication of error location
- Type checking and validation
- Terminal Experience
- Command history (up/down arrows)
- Clear screen command
- Tab completion
- Save/load expressions
- Beta Reduction Steps
- Show step-by-step reduction
- Visual tree representation
- Writing a Lambda Calculus Interpreter in JavaScript - Excellent tutorial by Tadeu Zagallo that I have mostly followed but changed where I couldn't follow.
- All the www folder is generated through claude.
Please help me with the pending test cases on interpreter.test.js and pointing mistakes in the interpreter. I have currently commented those out. I have also not completely grasped the interpreter written by Tadeu Zagallo too.
MIT