Unlambda Interpreter

Create, debug, share and run Unlambda code online.

Try Replit
Loved by 40 million app creators, including teams at:

Online Unlambda Interpreter Features

Combinatory Logic Fundamentals

  • Only three basic combinators—S (substitution), K (constant), I (identity) build all computation
  • No variables ever—functions manipulate other functions without naming them
  • Application is everything—` (backtick) applies one function to another: ``skk is K applied to result of s(k)
  • Turing-complete minimalism—proves you can compute anything with just three operations

S, K, I Combinators

  • S combinator: ```sxyz reduces to ``xz`yz—distributes z over x and y, then applies results
  • K combinator: ``kxy reduces to x—creates constant function that ignores second argument
  • I combinator: `ix reduces to x—identity function, can be built from S and K: ``skk ≡ i
  • Composition creates logic—conditionals, numbers, recursion all from S, K, I combinations

Church Encoding

  • Numbers as functions—0 is ``ki, 1 is i, higher numbers through function composition
  • Booleans as choice—true is k (selects first), false is ``ki (selects second)
  • Pairs for data structures—encode multiple values using function currying
  • No primitive types—everything constructed from pure function application

Theoretical Exploration

  • Study lambda calculus foundations—Unlambda proves computation without lambda abstraction
  • Minimal language design—understand what is truly necessary for universal computation
  • Esoteric programming challenge—pushing functional programming to philosophical extremes
  • Computer science education—visualize computational theory with concrete, runnable examples
Show moreShow less

Unlambda Keyboard Shortcuts

Shortcut Action Description
Ctrl + Enter Evaluate Unlambda Execute combinator expression and see result
Ctrl + S Save Unlambda Code Create shareable link for Unlambda programs
Ctrl + / Toggle Comment Comment/uncomment Unlambda code with #
Tab Indent Code Indent nested combinator expressions
Ctrl + D Duplicate Expression Copy combinator chains for testing variations
Ctrl + F Find Text Search for combinator patterns

Pro Tips

  • Start simple—test i, ``ki, ``skk to understand basic combinator reduction
  • Use ` (backtick) for function application—reads right to left like Haskell ($)
  • Build I from S and K: ``skk reduces to I, proving I is redundant
  • Output with .x where x is character to print—combine with functions for text output

Experience the power of Replit AI

This entire Unlambda compiler was built by Replit Agent 3 from a natural language prompt. Replit's environment facilitates rapid development, iteration and testing code for users of any technical ability. Develop software faster and better with Replit’s autonomous AI.

This entire Unlambda compiler was built by Replit Agent 3 from a natural language prompt. Replit's environment facilitates rapid development, iteration and testing code for users of any technical ability. Develop software faster and better with Replit’s autonomous AI.

Get started free

Frequently Asked Questions

What is Unlambda?

Unlambda is a minimalist functional esoteric programming language based on combinatory logic. Programs use only S, K, I combinators and function application—no variables, no lambda abstraction. It is Turing-complete despite extreme simplicity.

Why would I use Unlambda?

Unlambda is educational, not practical. It teaches combinatory logic, lambda calculus fundamentals, and theoretical computer science. Perfect for understanding what is essential in functional programming and exploring computational theory limits.

How do S, K, and I combinators work?

S applies two functions to the same argument: ```sxyz → ``xz`yz. K creates constant functions: ``kxy → x. I is identity: `ix → x. These three combinators can express any computable function through composition.

How do I write Hello World in Unlambda?

Use .x to output character x. Hello World is: .H.e.l.l.o.,. .W.o.r.l.d.!i (ending with i to satisfy evaluation). Unlambda focuses on computation theory, not practical programming—output is secondary.

Can I write useful programs in Unlambda?

Technically yes (it is Turing-complete), practically no. Unlambda is an esoteric language for exploring theoretical concepts, not building applications. Even simple programs become extremely complex due to no variables or structured syntax.

What is the backtick character?

Backtick ` is function application operator. ``abc applies function a to b, then applies result to c. Think of it like Haskell's $ or parentheses in Lisp. Applications read right-to-left.

How does Unlambda relate to lambda calculus?

Lambda calculus uses lambda abstraction to create functions. Unlambda achieves equivalent expressive power using only combinators—no lambda needed. It is a different formulation of the same computational foundation, proving variables are not essential.

Is Unlambda the simplest programming language?

One of them! Unlambda reduces computation to just function application with S, K, I combinators. Other minimal languages include Iota (single combinator) and Jot (binary encoding). All prove how little is needed for universal computation.

Build, test, and ship faster than ever with Replit

Replit is the only platform that combines a cloud IDE, Agentic Al coding, and seamless team collaboration to help you prototype and ship apps in record time. Build in 50+ languages, work from any device, and deploy in one click — no setup required.

Unlambda Keyboard Shortcuts
Open modal