λ Lambda Calculus CRDT Editor

Collaborative real-time editor with error recovery

Loading JavaScript...

Network Collaboration (Beta)

Not connected

Connect to collaborate with other peers in real-time. Make sure the signaling server is running:

node web/signaling-server.js

Basic Syntax & Examples

Literals

42          // Integer
x           // Variable

Lambda Functions

λx.x        // Identity function (using λ symbol)
\x.x        // Identity function (using backslash)
λf.λx.f x   // Nested lambdas

Arithmetic

1 + 2       // Addition
5 - 3       // Subtraction
a + b - c   // Chained operations (left-associative)

Function Application

f x         // Apply f to x
f x y       // Apply (f x) to y
(λx.x) 5    // Apply identity to 5

Conditionals

if x then 1 else 0
if x then y + 1 else y - 1

Grammar (EBNF)

Expression   ::= BinaryOp
BinaryOp     ::= Application (('+' | '-') Application)*
Application  ::= Atom+
Atom         ::= Integer | Variable | Lambda
               | IfThenElse | '(' Expression ')'
Lambda       ::= ('λ' | '\') Identifier '.' Expression
IfThenElse   ::= 'if' Expression 'then' Expression 'else' Expression
Examples:

AST Visualization

Waiting for input...

AST Structure & Parse Errors

Structure

Waiting for input...

Errors

  • No errors