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.

Fun2

From Esolang
Jump to navigation Jump to search

Fun2 is an esoteric dialect of JavaScript, created by User:AndrewBayly, and successor to Fun. Like Fun, a Fun2 program consists entirely of function calls. Fun2 extends Fun by adding a two-layer architecture: an S-expression layer for constructing Lisp data structures, and a Lisp interpreter layer that evaluates them. The result is a language that is genuinely Lisp, expressed in Fun's function-call syntax.

Turing completeness

Fun2 is Turing-complete. This follows directly from the fact that the interpreter layer implements a variant of tinylisp, which is itself Turing-complete. Unlike Fun, no explicit brainfuck translation is needed to establish this.

Implementation

The Fun2 interpreter is implemented as two JavaScript files: the S-expression layer and the interpreter layer. Both are plain JavaScript libraries with no dependencies. A Fun2 program is a JavaScript file that includes both libraries and calls RUN(...).

An interactive implementation is available at andrewbayly.github.io/esolangs/Fun2/.

See also

  • Fun — the predecessor language
  • tinylisp — the Lisp dialect implemented by the Fun2 interpreter layer