Thun

A Dialect of Joy.

Version 0.5.0

Simple pleasures are the best.

Joy is a programming language created by Manfred von Thun that is easy to use and understand and has many other nice properties. Thun is a dialect of Joy that attempts to stay very close to the spirit of Joy but does not precisely match the behaviour of the original version written in C.

Joy is:

The best source for learning about Joy is the information made available at the website of La Trobe University | (mirror) which contains source code for the original C interpreter, Joy language source code for various functions, and a great deal of fascinating material mostly written by Von Thun on Joy and its deeper facets as well as how to program in it and several interesting aspects. It's quite a treasure trove.

Example Code

Here is an example of Joy code. This function square_spiral accepts two integers and increments or decrements one of them such that the new pair of numbers is the next coordinate pair in a square spiral (like the kind used to construct an Ulam Spiral).

square_spiral [p] [then] [else] ifte

p  [p0] [p1] and
p0 [abs] ii <=
p1 [<>] [pop !-] or

then [    !-] [[++]] [[--]] ifte dip
else [pop !-]  [--]   [++]  ifte

It might seem unreadable but with familiarity it becomes as legible as any other notation.

Source

Documentation


Copyright © 2014 - 2025 Simon Forman