Rebuilt docs.

This commit is contained in:
sforman 2023-11-13 15:00:35 -08:00
parent c4cdbb0ef3
commit b7954a39a2
2 changed files with 32 additions and 76 deletions

View File

@ -125,7 +125,7 @@ of these:</p>
</ul> </ul>
<h3>Definitions</h3> <h3>Definitions</h3>
<p>Thun can be extended by adding new definitions to the <p>Thun can be extended by adding new definitions to the
<a href="https://git.sr.ht/~sforman/Thun/tree/trunk/item/implementations/defs.txt">defs.txt</a> <a href="https://ariadne.systems/gogs/sforman/Thun/src/trunk/implementations/defs.txt">defs.txt</a>
file and rebuilding the binaries. Each line in the file is a definition file and rebuilding the binaries. Each line in the file is a definition
consisting of the new symbol name followed by an expression for the body consisting of the new symbol name followed by an expression for the body
of the function.</p> of the function.</p>

View File

@ -20,26 +20,26 @@ programming language created by Manfred von Thun that is easy to use and
understand and has many other nice properties. <strong>Thun</strong> is a dialect of understand and has many other nice properties. <strong>Thun</strong> is a dialect of
Joy that attempts to stay very close to the spirit of Joy but does not 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. It precisely match the behaviour of the original version written in C. It
started as a Python project called "Joypy", but after someone claimed that started as a Python project called "Joypy", but after someone claimed
name on PyPI before me I renamed it to Thun in honor of Manfred Von Thun. that name on PyPI before me I renamed it to Thun in honor of Manfred Von
Now there are interpreters implemented in several additional languages Thun. Now there are interpreters implemented in several additional
(C, Nim, Prolog, Rust).</p> languages (C, Elm, Nim, OCaml, Prolog, and Scheme).</p>
<p>Joy is:</p> <p>Joy is:</p>
<ul> <ul>
<li><a href="https://en.wikipedia.org/wiki/Purely_functional_programming">Purely Functional</a></li> <li><a href="https://en.wikipedia.org/wiki/Purely_functional_programming">Purely Functional</a></li>
<li><a href="https://en.wikipedia.org/wiki/Stack-oriented_programming_language">Stack-based</a></li> <li><a href="https://en.wikipedia.org/wiki/Stack-oriented_programming_language">Stack-based</a></li>
<li><a href="https://en.wikipedia.org/wiki/Concatenative_programming_language">Concatinative</a> <li><a href="https://en.wikipedia.org/wiki/Concatenative_programming_language">Concatinative</a>
(See also <a href="http://www.concatenative.org/wiki/view/Concatenative%20language">concatenative.org</a>)</li> (See also <a href="http://www.concatenative.org/wiki/view/Concatenative%20language">concatenative.org</a>)</li>
<li><a href="https://joypy.osdn.io/notebooks/Categorical.html">Categorical</a></li> <li><a href="notebooks/Categorical.html">Categorical</a></li>
</ul> </ul>
<p>The best source (no pun intended) for learning about Joy is the <p>The best source for learning about Joy is the information made available
information made available at the at the <a href="http://www.latrobe.edu.au/humanities/research/research-projects/past-projects/joy-programming-language">website of La Trobe University</a>
<a href="http://www.latrobe.edu.au/humanities/research/research-projects/past-projects/joy-programming-language">website of La Trobe University</a> | <a href="https://www.kevinalbrecht.com/code/joy-mirror/">(mirror)</a> which
| <a href="https://www.kevinalbrecht.com/code/joy-mirror/">(mirror)</a> contains source code for the original C interpreter, Joy language source
which contains source code for the original C interpreter, Joy language source code for various functions, code for various functions, and a great deal of fascinating material
and a great deal of fascinating material mostly written by Von Thun on mostly written by Von Thun on Joy and its deeper facets as well as how to
Joy and its deeper facets as well as how to program in it and several program in it and several interesting aspects. It's quite a treasure
interesting aspects. It's quite a treasure trove.</p> trove.</p>
<ul> <ul>
<li><a href="https://en.wikipedia.org/wiki/Joy_%28programming_language%29">Wikipedia entry for Joy</a></li> <li><a href="https://en.wikipedia.org/wiki/Joy_%28programming_language%29">Wikipedia entry for Joy</a></li>
<li><a href="http://www.latrobe.edu.au/humanities/research/research-projects/past-projects/joy-programming-language">Homepage at La Trobe University</a> <li><a href="http://www.latrobe.edu.au/humanities/research/research-projects/past-projects/joy-programming-language">Homepage at La Trobe University</a>
@ -51,81 +51,37 @@ interesting aspects. It's quite a treasure trove.</p>
two integers and increments or decrements one of them such that the new 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 pair of numbers is the next coordinate pair in a square spiral (like the
kind used to construct an <a href="https://en.wikipedia.org/wiki/Ulam_spiral">Ulam Spiral</a>). kind used to construct an <a href="https://en.wikipedia.org/wiki/Ulam_spiral">Ulam Spiral</a>).
For more information see <a href="/notebooks/Square_Spiral.html">Square Spiral Example Joy Code</a>.</p> For more information see <a href="notebooks/Square_Spiral.html">Square Spiral Example Joy Code</a>.</p>
<pre><code>square_spiral [_p] [_then] [_else] ifte <pre><code>square_spiral [p] [then] [else] ifte
_p [_p0] [_p1] and p [p0] [p1] and
_p0 [abs] ii &lt;= p0 [abs] ii &lt;=
_p1 [&lt;&gt;] [pop !-] or p1 [&lt;&gt;] [pop !-] or
_then [ !-] [[++]] [[--]] ifte dip then [ !-] [[++]] [[--]] ifte dip
_else [pop !-] [--] [++] ifte else [pop !-] [--] [++] ifte
</code></pre> </code></pre>
<p>It might seem unreadable but with familiarity it becomes as legible as any other notation.</p> <p>It might seem unreadable but with familiarity it becomes as legible as
<h2>Project Hosted on <a href="https://git.sr.ht/~sforman/Thun">SourceHut</a></h2> any other notation.</p>
<h2>Project Hosted on <a href="https://ariadne.systems/gogs/sforman/Thun">Ariadne Systems</a></h2>
<ul> <ul>
<li><a href="https://git.sr.ht/~sforman/Thun">Source Repository</a> <li><a href="https://ariadne.systems/gogs/sforman/Thun">Source Repository</a>
(<a href="https://github.com/calroc/Thun">mirror</a>)</li> (<a href="https://github.com/calroc/Thun">mirror</a>)</li>
<li><a href="https://todo.sr.ht/~sforman/thun-der">Bug tracker</a> <li><a href="https://ariadne.systems/gogs/sforman/Thun/issues">Bug tracker</a>
(<a href="https://osdn.net/projects/joypy/ticket/">old tracker</a>)</li> (<a href="https://osdn.net/projects/joypy/ticket/">old tracker</a>)</li>
<li><a href="https://osdn.net/projects/joypy/forums/">Forums</a></li> <li><a href="https://osdn.net/projects/joypy/forums/">Forums</a></li>
<li><a href="https://osdn.net/projects/joypy/lists/">Mailing list</a></li> <li><a href="https://osdn.net/projects/joypy/lists/">Mailing list</a></li>
</ul> </ul>
<h2>Documentation</h2> <h2>Documentation</h2>
<p>This document describes Joy in a general way below, however most of the <p>The <a href="Thun.html">Thun specification</a> document describes the Thun dialect,
documentation is in the form of <a href="/notebooks/index.html">Jupyter Notebooks</a> however most of the
documentation is in the form of <a href="notebooks/index.html">Jupyter Notebooks</a>
that go into more detail.</p> that go into more detail.</p>
<p><strong><a href="/notebooks/index.html">Jupyter Notebooks</a></strong></p> <p><strong><a href="notebooks/index.html">Jupyter Notebooks</a></strong></p>
<p>There's also a <a href="/FuncRef.html">Function Reference</a> that lists each <p>There's also a <a href="FuncRef.html">Function Reference</a> that lists each
function and combinator by name and gives a brief description. (It's function and combinator by name and gives a brief description. (It's
usually out of date, I'm working on it.)</p> usually out of date, I'm working on it.)</p>
<p><strong><a href="/FuncRef.html">Function Reference</a></strong></p> <p><strong><a href="FuncRef.html">Function Reference</a></strong></p>
<h3>Building the Docs</h3>
<p>Run <code>make</code> in the <code>docs</code> directory. (This is a lie, it's more complex than
that. Really you need to run (GNU) make in the <code>docs/notebooks</code> and
<code>docs/reference</code> dirs first, <em>then</em> run <code>make</code> in the <code>docs</code> directory.)</p>
<h2>Directory structure</h2>
<pre><code>Thun
|-- LICENSE - GPLv3
|-- README.md - this file
|
|-- archive
| |-- Joy-Programming.zip
| `-- README
|
|-- docs
| |-- dep-graphs - Generated dependency graphs.
| |-- html - Generated HTML docs.
| |-- notebooks - Jupyter Notebooks and supporting modules
| `-- reference - Docs for each function.
|
|-- implementations
| |-- defs.txt - common Joy definitions for all interpreters
| |-- C - interpreter
| |-- GNUProlog - interpreter
| | type inference
| | work-in-progress compiler
| |
| |-- Nim - interpreter
| |-- Ocaml - work-in-progress interpreter
| `-- Python - interpreter
|
`-- joy_code - Source code written in Joy.
`-- bigints
`-- bigints.joy
</code></pre>
<h2>Installation</h2>
<p>Clone the repo and follow the instructions in the individual
<code>implementations</code> directories. There isn't really any installation. You
can put the binaries in your <code>PATH</code>.</p>
<p>(I had the Python package set up to upload to PyPI as "Thun", but the
whole Python distribution story seems unsettled at the moment (2023) so
I've gone back to the <em>old ways</em>: there is a single script <code>joy.py</code>
that gets modified (<code>defs.txt</code> is inserted) to create a <code>joy</code> script
that uses the "shebang" trick to pretend to be a binary. In other words,
run <code>make</code> and put the resulting <code>joy</code> script in your PATH, if that's
what you want to do. In a year or two the Python folks will have sorted
things out and we can go back to <code>pip install Thun</code> or whatever.)</p>
<h2>Basics of Joy</h2> <h2>Basics of Joy</h2>
<p>The original Joy has several datatypes (such as strings and sets) <p>The original Joy has several datatypes (such as strings and sets)
but the Thun dialect currently only uses four:</p> but the Thun dialect currently only uses four:</p>