7 > Simple pleasures are the best.
9 [Joy](https://en.wikipedia.org/wiki/Joy_%28programming_language%29) is a
10 programming language created by Manfred von Thun that is easy to use and
11 understand and has many other nice properties. **Thun** is a dialect of
12 Joy that attempts to stay very close to the spirit of Joy but does not
13 precisely match the behaviour of the original version written in C. It
14 started as a Python project called "Joypy", but after someone claimed
15 that name on PyPI before me I renamed it to Thun in honor of Manfred Von
16 Thun. Now there are interpreters implemented in several additional
17 languages (C, Elm, Nim, OCaml, Prolog, and Scheme).
21 * [Purely Functional](https://en.wikipedia.org/wiki/Purely_functional_programming)
22 * [Stack-based](https://en.wikipedia.org/wiki/Stack-oriented_programming_language)
23 * [Concatinative](https://en.wikipedia.org/wiki/Concatenative_programming_language)
24 (See also [concatenative.org](http://www.concatenative.org/wiki/view/Concatenative%20language))
25 * [Categorical](https://joypy.osdn.io/notebooks/Categorical.html)
27 The best source for learning about Joy is the information made available
28 at the [website of La Trobe University](http://www.latrobe.edu.au/humanities/research/research-projects/past-projects/joy-programming-language)
29 | [(mirror)](https://www.kevinalbrecht.com/code/joy-mirror/) which
30 contains source code for the original C interpreter, Joy language source
31 code for various functions, and a great deal of fascinating material
32 mostly written by Von Thun on Joy and its deeper facets as well as how to
33 program in it and several interesting aspects. It's quite a treasure
36 * [Wikipedia entry for Joy](https://en.wikipedia.org/wiki/Joy_%28programming_language%29)
37 * [Homepage at La Trobe University](http://www.latrobe.edu.au/humanities/research/research-projects/past-projects/joy-programming-language)
38 [(Kevin Albrecht's mirror)](https://www.kevinalbrecht.com/code/joy-mirror/)
39 * [The original Thun/Joypy site](https://web.archive.org/web/20220411010035/https://joypy.osdn.io/)
44 Here is an example of Joy code. This function `square_spiral` accepts
45 two integers and increments or decrements one of them such that the new
46 pair of numbers is the next coordinate pair in a square spiral (like the
47 kind used to construct an [Ulam Spiral](https://en.wikipedia.org/wiki/Ulam_spiral)).
48 For more information see [Square Spiral Example Joy Code](https://joypy.osdn.io/notebooks/Square_Spiral.html).
50 square_spiral [_p] [_then] [_else] ifte
56 _then [ !-] [[++]] [[--]] ifte dip
57 _else [pop !-] [--] [++] ifte
59 It might seem unreadable but with familiarity it becomes as legible as
63 ## Project Hosted on [SourceHut](https://git.sr.ht/~sforman/Thun)
65 * [Source Repository](https://git.sr.ht/~sforman/Thun)
66 ([mirror](https://github.com/calroc/Thun))
67 * [Bug tracker](https://todo.sr.ht/~sforman/thun-der)
68 ([old tracker](https://osdn.net/projects/joypy/ticket/))
69 * [Forums](https://osdn.net/projects/joypy/forums/)
70 * [Mailing list](https://osdn.net/projects/joypy/lists/)
75 The `Thun.md` document describes the Thun dialect. Most of the rest of
76 documentation is in the form of
77 [Jupyter Notebooks](https://joypy.osdn.io/notebooks/index.html)
78 that go into more detail.
80 **[Jupyter Notebooks](https://joypy.osdn.io/notebooks/index.html)**
82 I had a Joy kernel for the Jupyter Notebook system, but I can no longer
83 figure out how to use it, so I'm rewriting the notebooks by hand.
85 There's also a [Function Reference](https://git.sr.ht/~sforman/Thun/tree/trunk/item/docs/reference) that lists each
86 function and combinator by name and gives a brief description. (It's
87 usually out of date, I'm working on it.)
89 **[Function Reference](https://git.sr.ht/~sforman/Thun/tree/trunk/item/docs/reference)**
91 There is more in the `docs` directory but it's kind of a mess right now
95 ## Directory structure
99 |-- README.md - this file
102 | |-- Joy-Programming.zip
106 | |-- dep-graphs - Generated dependency graphs.
107 | |-- html - Generated HTML docs.
108 | |-- notebooks - Jupyter Notebooks and supporting modules
109 | `-- reference - Docs for each function.
112 | |-- defs.txt - common Joy definitions for all interpreters
113 | |-- C - interpreter
114 | |-- GNU Prolog - type inference
115 | |-- Elm - interpreter
116 | |-- Nim - interpreter
117 | |-- Ocaml - work-in-progress interpreter
118 | |-- Python - interpreter
119 | |-- Scheme - interpreter
120 | `-- SWI Prolog - interpreter
122 | work-in-progress compiler
124 `-- joy_code - Source code written in Joy.
133 git clone https://git.sr.ht/~sforman/Thun
135 Then follow the instructions in the individual `implementations`
136 directories. In most cases you can just run `make` and that will build a
137 binary called `joy` (in Python it's a script.)
139 There isn't really any installation as such. You can put the binaries in
148 --------------------------------------------------
150 Copyright © 2014 - 2023 Simon Forman
152 This file is part of Thun