We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
Fun3
Fun3 is an esoteric programming language by User:AndrewBayly, the third in a series of languages (after Fun and Fun2) built on the same concept: a dialect of JavaScript in which an entire program is a single nested function call, and every parameter is itself a function call. Where Fun turned out to be highly imperative and Fun2 achieved a functional style by building an S-expression tree and interpreting it with a small Lisp, Fun3 drops the intermediate interpreter altogether. Its programs build a tree of SKI combinators directly out of nested calls, then reduce the whole tree with a single final call. The fit is close to exact: SKI calculus has no variables or binding forms to represent, so it collapses into JavaScript's own call syntax with nothing left over.
Design
A Fun3 program is a single expression of the form CALL(...). The library consists of six functions:
S(),K(),I()— return the corresponding combinator.APP(a, b)— returns a deferred application node representing a applied to b.CALL(a)— forces the tree built from nestedAPPcalls down to a normal form.PRINT(x)— forces its argument, checks whether it behaves as a Church numeral by probing it with a successor function and zero, prints the result if so, and returns its argument unchanged (so it can be dropped anywhere in a tree without affecting the computation).
Because SKI terms have no data type beyond functions, PRINT's numeral detection is a heuristic (duck typing), not a type check.
The reference implementation reduces terms lazily: applications are built as deferred thunks and only forced when something actually calls them as a function. This distinction matters more than it first appears — an early version of the interpreter forced both branches of the S-rule (S x y z = x z (y z)) eagerly, which meant K could never actually protect a divergent argument from being evaluated, since the divergent computation had already run by the time K had a chance to discard it. Only a properly deferred second branch gives the reduction genuine normal-order semantics.
External Resources
- Reference Implementation - single-file HTML/JS interpreter