**Unlambda** is aminimal language of functional programming invented by David Madore. It is based on the principle of combinatorial logic , a version of the lambda-calculus that omits the lambda operator. It relies mainly on two built-in functions (* s* and* k* ) and on an* apply* operator(written* `* , the inverted quote). It is therefore a complete Turing languageand also includes some I / O functions allowing user interaction, various shortcut functions and a lazy evaluation function .

## Fundamentals

Due to its nature of exotic programming language , Unlambda is more a demonstration of functional programming pushed to the extreme than a language usable for practical purposes. Its main feature is its lack of conventional operators and typed variables. The only usable data type consists of single-parameter functions. The user can, however, simulate other data by calling suitable functions, such as lambda-calculus . The functions with several parameters can be represented by the technique of currying .

The Unlambda language is based on the principles of combinatorial logic , in particular as regards the elimination of all variables in memory as well as functions. Since this is a purely functional language, not only are the functions of Unlambda first class objects , but they are also the only ones.

A version of the Hello world in Unlambda can be ^{1} :

`R```````````.Hello .worldi

## Internal functions

The notation

indicates a function taking an argument and returning it unchanged, with the side effect of displaying the character `.x`

*x* when called.

Is a version of the identity function that does not have this side effect. It is therefore used as a fictitious parameter. The code `i`

applies the display to the fictitious ``.di`

argument `d`

, returns `i`

and displays `i`

doing so. Similarly, `d`

first applies ```.l.di`

to `.l`

, displaying `.d`

and returning `l`

, which is then applied to `.d`

as in the previous example. Function `i`

is a form of syntactic sugar that displays a line break .`r`

Among the other important functions of Unlambda are the functions

and `k`

. `s`

Makes it possible to fabricate constant functions: thus `k`

returns ``kxy`

*x* when it is called, and

always returns ```kxy`

*x* , for all *x* and *y* .

Is a generalized evaluation operator. `s`

Is evaluated as ````sxyz`

for all ```xy`z`

*x* , *y* and *z* . It is remarkable that the functions

and `s`

are sufficient to perform any computation, as shown by the SKI combinational computer. An example is an implementation of the function `k`

by `i`

, since ```skk`

returns ````skkx`

*x* for all *x* .

The control flow of Unlambda is the call with current continuation, noted

. When an expression of the form `c`

is evaluated , a special ``cx`

*continuation* object is constructed that represents the state of the interpreter at that particular time. *X* is then *evaluated* , and the result is given to the *continuation* as an argument. If the continuation does not receive an argument, the value of the expression

is identical to that of ``cx`

*x* . But if the continuation receives a value *y* , the execution of *x* is stopped, and the value of the whole expression

is ``cx`

*y* .

Although the evaluation of Unlambda is normally strict , the operator activates

a lazy evaluation option . Usually, to evaluate an expression of the form `d`

, Unlambda evaluates first ``xy`

*x* , then *y* , then applies *x* to *y* . However, if *x* has a value

, `d`

*y* is not evaluated ; Instead, the value of the expression

becomes a special object of ``dy`

*delayed continuation* which, applied to an object *z* , *evaluates **y* , then applies it to *z* . It is noted that in the absence of side effects, it is equivalent to

.``iy`

``iy`

``dy`

## Notes and references

- ↑ ( in ) ”
*Good Math, Bad Math*(blog): Friday Pathological Programming: unlambda, gold Without Programming Variables ” [ archive ]