1. Home
  2. /
  3. Unlambda
  4. /
  5. Simple Function Application

Simple Function Application - Unlambda Typing CST Test

Loading…

Simple Function Application — Unlambda Code

Demonstrates applying the identity function `i` to print 'B'.

`i.B

Unlambda Language Guide

Unlambda is an esoteric functional programming language based on combinatory logic. It eschews traditional variables and functions in favor of function application using only a small set of combinators, emphasizing minimalism and theoretical computation.

Primary Use Cases

  • ▸Experimenting with combinatory logic and functional programming
  • ▸Educational examples in theoretical computer science
  • ▸Recreational programming and code-golf challenges
  • ▸Demonstrating Turing-completeness in minimal languages
  • ▸Exploring minimalist programming paradigms

Notable Features

  • ▸Minimalistic syntax with a few combinators
  • ▸No variables, loops, or traditional functions
  • ▸Focus on function application
  • ▸Supports input/output via special operators
  • ▸Turing-complete despite extreme minimalism

Origin & Creator

Unlambda was created by David Madore in 1999 as a demonstration of functional programming concepts and minimalistic design in Turing-complete languages.

Industrial Note

Unlambda is mostly a theoretical and hobbyist language. It is used to explore the limits of functional programming, combinatory logic, and to challenge programmers with extreme minimalism.

Quick Explain

  • ▸Unlambda is based on SKI combinatory logic, where programs are constructed from function applications.
  • ▸It does not have named variables or conventional control structures.
  • ▸Output and input are handled via the '.' and ',' operators, respectively.
  • ▸Unlambda programs are often challenging to read due to their extreme minimalism.
  • ▸It is primarily used for academic, experimental, and recreational programming.

Core Features

  • ▸Primary combinators: `s`, `k`, `i`, `v`, `c`, `d`, `@`
  • ▸Function application is left-associative
  • ▸Output with `.` operator
  • ▸Input with `,` operator
  • ▸Conditional logic via combinator constructs

Learning Path

  • ▸Understand basic combinatory logic (SKI calculus)
  • ▸Learn Unlambda syntax and combinators
  • ▸Run simple programs to print output
  • ▸Experiment with input/output combinators
  • ▸Write small algorithms entirely in combinators

Practical Examples

  • ▸Printing 'Hello, world!' in Unlambda
  • ▸Reading input and echoing characters
  • ▸Implementing a factorial function using combinators
  • ▸Building a simple counter
  • ▸Solving code-golf challenges

Comparisons

  • ▸Unlambda vs Brainfuck -> Both esoteric, Unlambda: combinatory logic, Brainfuck: memory tape
  • ▸Unlambda vs Haskell -> Haskell: practical functional programming, Unlambda: minimal theoretical demonstration
  • ▸Unlambda vs Lisp -> Lisp: macros and variables, Unlambda: no variables, only combinators
  • ▸Unlambda vs C -> C: imperative, practical, Unlambda: minimal and academic
  • ▸Unlambda vs Lambda Calculus -> Unlambda implements lambda calculus via combinators

Strengths

  • ▸Demonstrates theoretical foundations of functional programming
  • ▸Extremely small and minimal language
  • ▸Challenges conventional programming paradigms
  • ▸Good for educational and recreational purposes
  • ▸Turing-complete and capable of arbitrary computation

Limitations

  • ▸Not practical for real-world programming
  • ▸Difficult to read, write, and debug
  • ▸Steep learning curve for beginners
  • ▸Limited ecosystem and tooling
  • ▸Mostly academic or hobbyist relevance

When NOT to Use

  • ▸Production software development
  • ▸Projects requiring maintainable code
  • ▸High-performance or scalable systems
  • ▸GUI or web development
  • ▸Data-intensive applications

Cheat Sheet

  • ▸s, k, i - basic combinators
  • ▸.c - print character c
  • ▸, - read input character
  • ▸` - function application (left-associative)
  • ▸v - discard argument, @ - call/loop combinator

FAQ

  • ▸Is Unlambda practical? -> No, mostly academic and recreational
  • ▸Do I need prior functional programming knowledge? -> Helpful but not strictly required
  • ▸Can Unlambda do I/O? -> Yes, via `.` and `,` operators
  • ▸Is Unlambda Turing-complete? -> Yes, it can compute anything computable
  • ▸Are there interpreters available? -> Yes, in C, Python, JavaScript, and online REPLs

30-Day Skill Plan

  • ▸Week 1: Run and understand existing programs
  • ▸Week 2: Learn and trace combinator applications
  • ▸Week 3: Write small custom programs
  • ▸Week 4: Implement basic algorithms (factorial, sum, etc.)
  • ▸Week 5: Explore Turing-completeness demonstrations

Final Summary

  • ▸Unlambda is an extremely minimal functional programming language.
  • ▸It is based on combinatory logic and implements Turing-complete computation.
  • ▸No variables or conventional control structures are used.
  • ▸I/O is handled through dedicated combinators.
  • ▸Unlambda serves educational, recreational, and theoretical purposes.

Project Structure

  • ▸Single `.ul` file containing combinator expressions
  • ▸No directories or modules by default
  • ▸Optional comments in some interpreters
  • ▸Input/output handled inline
  • ▸Entire logic embedded in combinator chains

Monetization

  • ▸Primarily academic or hobbyist; limited commercial value
  • ▸Workshops or courses using Unlambda
  • ▸Books and tutorials on esoteric languages
  • ▸Online coding challenges or contests
  • ▸Merchandising is rare

Productivity Tips

  • ▸Start small and incrementally increase complexity
  • ▸Use interpreter debug modes
  • ▸Read and reuse community examples
  • ▸Annotate combinator chains for clarity
  • ▸Focus on understanding evaluation rather than efficiency

Basic Concepts

  • ▸Combinators - fundamental building blocks (`s`, `k`, `i`)
  • ▸Application - left-associative function application
  • ▸Output - `.` operator prints characters
  • ▸Input - `,` operator reads characters
  • ▸Conditional logic - implemented using combinators like `c` and `d`

Official Docs

  • ▸http://www.ioccc.org/years.html#1999-madore
  • ▸https://esolangs.org/wiki/Unlambda

More Unlambda Typing Exercises

Hello World in UnlambdaPrint Single CharacterRepeat PrintingConditional ExampleLambda CompositionNested FunctionsLooping PrintEcho Input CharacterComplex Hello

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher