OSDN Git Service

Bleah.
[joypy/Thun.git] / docs / sphinx_docs / _build / html / index.html
1
2 <!DOCTYPE html>
3
4 <html>
5   <head>
6     <meta charset="utf-8" />
7     <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
8
9     <title>Thun 0.4.1 Documentation &#8212; Thun 0.4.1 documentation</title>
10     <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
11     <link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
12     <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
13     <script src="_static/jquery.js"></script>
14     <script src="_static/underscore.js"></script>
15     <script src="_static/doctools.js"></script>
16     <link rel="index" title="Index" href="genindex.html" />
17     <link rel="search" title="Search" href="search.html" />
18     <link rel="next" title="Thun: Joy in Python" href="notebooks/Intro.html" />
19    
20   <link rel="stylesheet" href="_static/custom.css" type="text/css" />
21   
22   
23   <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
24
25   </head><body>
26   
27
28     <div class="document">
29       <div class="documentwrapper">
30         <div class="bodywrapper">
31           
32
33           <div class="body" role="main">
34             
35   <section id="thun-release-documentation">
36 <h1>Thun 0.4.1 Documentation<a class="headerlink" href="#thun-release-documentation" title="Permalink to this headline">¶</a></h1>
37 <p>Thun is dialect of Joy written in Python.</p>
38 <p><a class="reference external" href="https://en.wikipedia.org/wiki/Joy_(programming_language)">Joy</a> is a programming language created by Manfred von Thun that is easy to
39 use and understand and has many other nice properties.  This Python
40 package implements an interpreter for a dialect of Joy that attempts to
41 stay very close to the spirit of Joy but does not precisely match the
42 behaviour of the original version(s) written in C.  The main difference
43 between Thun and the originals, other than being written in Python, is
44 that it works by the “Continuation-Passing Style”.</p>
45 <p>Joy is:</p>
46 <ul class="simple">
47 <li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Purely_functional_programming">Purely Functional</a></p></li>
48 <li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Stack-oriented_programming_language">Stack-based</a></p></li>
49 <li><p><a class="reference external" href="https://en.wikipedia.org/wiki/Concatenative_programming_language">Concatinative</a> ( See also <a class="reference external" href="http://www.concatenative.org/wiki/view/Concatenative%20language">concatenative.org</a>)</p></li>
50 <li><p><a class="reference internal" href="notebooks/Categorical.html"><span class="doc">Categorical</span></a></p></li>
51 </ul>
52 <p>I hope that this package is useful in the sense that it provides an
53 additional joy interpreter (the binary in the archive from La Trobe seems
54 to run just fine on my modern Linux machine!)  But I also hope that you
55 can read and understand the Python code and play with the implementation
56 itself.</p>
57 <section id="example-code">
58 <h2>Example Code<a class="headerlink" href="#example-code" title="Permalink to this headline">¶</a></h2>
59 <p>Here is an example of Joy code:</p>
60 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>[[[abs]ii &lt;=][[&lt;&gt;][pop !-]||]&amp;&amp;][[!-][[++]][[--]]ifte dip][[pop !-][--][++]ifte]ifte
61 </pre></div>
62 </div>
63 <p>It might seem unreadable but with a little familiarity it becomes just as
64 legible as any other notation.  Some layout helps:</p>
65 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>[   [[abs] ii &lt;=]
66     [
67         [&lt;&gt;] [pop !-] ||
68     ] &amp;&amp;
69 ]
70 [[    !-] [[++]] [[--]] ifte dip]
71 [[pop !-]  [--]   [++]  ifte    ]
72 ifte
73 </pre></div>
74 </div>
75 <p>This function accepts two integers on the stack and increments or
76 decrements one of them such that the new pair of numbers is the next
77 coordinate pair in a square spiral (like the kind used to construct an
78 <a class="reference external" href="https://en.wikipedia.org/wiki/Ulam_spiral">Ulam Spiral</a>).  For more information see <a class="reference internal" href="notebooks/Square_Spiral.html"><span class="doc">Square Spiral Example Joy Code</span></a></p>
79 </section>
80 <section id="quick-start">
81 <h2>Quick Start<a class="headerlink" href="#quick-start" title="Permalink to this headline">¶</a></h2>
82 <p>Install from <a class="reference external" href="https://pypi.org/project/Thun/">PyPI</a> in the usual way:</p>
83 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ pip install Thun
84 </pre></div>
85 </div>
86 <p>To start the REPL:</p>
87 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ python -m joy
88 </pre></div>
89 </div>
90 <p>Continue with <a class="reference internal" href="notebooks/Intro.html"><span class="doc">the introduction</span></a>.</p>
91 </section>
92 <section id="project-hosted-on-osdn">
93 <h2>Project Hosted on <a class="reference external" href="https://osdn.net/projects/joypy/">OSDN</a><a class="headerlink" href="#project-hosted-on-osdn" title="Permalink to this headline">¶</a></h2>
94 <ul class="simple">
95 <li><p><a class="reference external" href="https://osdn.net/projects/joypy/scm/git/Thun/">Source Repository</a> (<a class="reference external" href="https://github.com/calroc/Thun">mirror</a>)</p></li>
96 <li><p><a class="reference external" href="https://todo.sr.ht/~sforman/thun-der">Bug tracker</a> (<a class="reference external" href="https://osdn.net/projects/joypy/ticket/">old tracker</a>)</p></li>
97 <li><p><a class="reference external" href="https://osdn.net/projects/joypy/forums/">Forums</a></p></li>
98 <li><p><a class="reference external" href="https://osdn.net/projects/joypy/lists/">Mailing list</a></p></li>
99 </ul>
100 </section>
101 <section id="information-on-the-joy-language">
102 <h2>Information on the Joy language<a class="headerlink" href="#information-on-the-joy-language" title="Permalink to this headline">¶</a></h2>
103 <p>See <a class="reference external" href="https://en.wikipedia.org/wiki/Joy_(programming_language)">the Wikipedia article</a> and <a class="reference external" href="http://www.kevinalbrecht.com/code/joy-mirror/index.html">Kevin Albrecht’s mirror of Manfred von Thun’s original website for the Joy Programming Language</a> for more information on the Joy language.</p>
104 <p>The best source (no pun intended) for learning about Joy is the
105 information made available at the website of La Trobe University (see the
106 mirror link above) which contains source code for the
107 original C interpreter, Joy language source code for various functions,
108 and a great deal of fascinating material mostly written by Von Thun on
109 Joy and its deeper facets as well as how to program in it and several
110 interesting aspects.  It’s quite a treasure trove.</p>
111 </section>
112 <section id="documentation-on-thun-dialect">
113 <h2>Documentation on Thun Dialect<a class="headerlink" href="#documentation-on-thun-dialect" title="Permalink to this headline">¶</a></h2>
114 <p>The following is specific information for this dialect of Joy.</p>
115 <div class="toctree-wrapper compound">
116 <ul>
117 <li class="toctree-l1"><a class="reference internal" href="notebooks/Intro.html">Thun: Joy in Python</a><ul>
118 <li class="toctree-l2"><a class="reference internal" href="notebooks/Intro.html#read-eval-print-loop-repl">Read-Eval-Print Loop (REPL)</a></li>
119 <li class="toctree-l2"><a class="reference internal" href="notebooks/Intro.html#the-stack">The Stack</a></li>
120 <li class="toctree-l2"><a class="reference internal" href="notebooks/Intro.html#purely-functional-datastructures">Purely Functional Datastructures</a></li>
121 <li class="toctree-l2"><a class="reference internal" href="notebooks/Intro.html#the-joy-function">The <code class="docutils literal notranslate"><span class="pre">joy()</span></code> function</a></li>
122 <li class="toctree-l2"><a class="reference internal" href="notebooks/Intro.html#parser">Parser</a></li>
123 <li class="toctree-l2"><a class="reference internal" href="notebooks/Intro.html#library">Library</a></li>
124 </ul>
125 </li>
126 <li class="toctree-l1"><a class="reference internal" href="joy.html">Joy Interpreter</a><ul>
127 <li class="toctree-l2"><a class="reference internal" href="joy.html#module-joy.joy"><code class="docutils literal notranslate"><span class="pre">joy.joy</span></code></a></li>
128 </ul>
129 </li>
130 <li class="toctree-l1"><a class="reference internal" href="stack.html">Stack or Quote or Sequence or List…</a><ul>
131 <li class="toctree-l2"><a class="reference internal" href="stack.html#module-joy.utils.stack"><code class="docutils literal notranslate"><span class="pre">joy.utils.stack</span></code></a></li>
132 </ul>
133 </li>
134 <li class="toctree-l1"><a class="reference internal" href="parser.html">Parsing Text into Joy Expressions</a><ul>
135 <li class="toctree-l2"><a class="reference internal" href="parser.html#module-joy.parser"><code class="docutils literal notranslate"><span class="pre">joy.parser</span></code></a></li>
136 <li class="toctree-l2"><a class="reference internal" href="parser.html#parser-internals">Parser Internals</a></li>
137 </ul>
138 </li>
139 <li class="toctree-l1"><a class="reference internal" href="pretty.html">Tracing Joy Execution</a><ul>
140 <li class="toctree-l2"><a class="reference internal" href="pretty.html#module-joy.utils.pretty_print"><code class="docutils literal notranslate"><span class="pre">joy.utils.pretty_print</span></code></a></li>
141 </ul>
142 </li>
143 <li class="toctree-l1"><a class="reference internal" href="library.html">Function Reference</a><ul>
144 <li class="toctree-l2"><a class="reference internal" href="library.html#module-joy.library"><code class="docutils literal notranslate"><span class="pre">joy.library</span></code></a></li>
145 <li class="toctree-l2"><a class="reference internal" href="library.html#module-joy.utils.generated_library">Auto-generated Functions</a></li>
146 </ul>
147 </li>
148 <li class="toctree-l1"><a class="reference internal" href="lib.html">Functions Grouped by, er, Function with Examples</a><ul>
149 <li class="toctree-l2"><a class="reference internal" href="lib.html#stack-chatter">Stack Chatter</a></li>
150 <li class="toctree-l2"><a class="reference internal" href="lib.html#list-words">List words</a></li>
151 <li class="toctree-l2"><a class="reference internal" href="lib.html#math-words">Math words</a></li>
152 <li class="toctree-l2"><a class="reference internal" href="lib.html#logic-and-comparison">Logic and Comparison</a></li>
153 <li class="toctree-l2"><a class="reference internal" href="lib.html#miscellaneous">Miscellaneous</a></li>
154 <li class="toctree-l2"><a class="reference internal" href="lib.html#combinators">Combinators</a></li>
155 <li class="toctree-l2"><a class="reference internal" href="lib.html#void"><code class="docutils literal notranslate"><span class="pre">void</span></code></a></li>
156 </ul>
157 </li>
158 <li class="toctree-l1"><a class="reference internal" href="types.html">Type Inference of Joy Expressions</a><ul>
159 <li class="toctree-l2"><a class="reference internal" href="types.html#joy-utils-types"><code class="docutils literal notranslate"><span class="pre">joy.utils.types</span></code></a></li>
160 </ul>
161 </li>
162 <li class="toctree-l1"><a class="reference internal" href="notebooks/index.html">Essays about Programming in Joy</a><ul>
163 <li class="toctree-l2"><a class="reference internal" href="notebooks/Developing.html">Developing a Program in Joy</a></li>
164 <li class="toctree-l2"><a class="reference internal" href="notebooks/Quadratic.html">Quadratic formula</a></li>
165 <li class="toctree-l2"><a class="reference internal" href="notebooks/Replacing.html">Replacing Functions in the Dictionary</a></li>
166 <li class="toctree-l2"><a class="reference internal" href="notebooks/Recursion_Combinators.html">Recursion Combinators</a></li>
167 <li class="toctree-l2"><a class="reference internal" href="notebooks/Ordered_Binary_Trees.html">Treating Trees I: Ordered Binary Trees</a></li>
168 <li class="toctree-l2"><a class="reference internal" href="notebooks/Treestep.html">Treating Trees II: <code class="docutils literal notranslate"><span class="pre">treestep</span></code></a></li>
169 <li class="toctree-l2"><a class="reference internal" href="notebooks/Generator_Programs.html">Using <code class="docutils literal notranslate"><span class="pre">x</span></code> to Generate Values</a></li>
170 <li class="toctree-l2"><a class="reference internal" href="notebooks/Newton-Raphson.html">Newton’s method</a></li>
171 <li class="toctree-l2"><a class="reference internal" href="notebooks/Square_Spiral.html">Square Spiral Example Joy Code</a></li>
172 <li class="toctree-l2"><a class="reference internal" href="notebooks/Zipper.html">Traversing Datastructures with Zippers</a></li>
173 <li class="toctree-l2"><a class="reference internal" href="notebooks/Types.html">The Blissful Elegance of Typing Joy</a></li>
174 <li class="toctree-l2"><a class="reference internal" href="notebooks/TypeChecking.html">Type Checking</a></li>
175 <li class="toctree-l2"><a class="reference internal" href="notebooks/NoUpdates.html">No Updates</a></li>
176 <li class="toctree-l2"><a class="reference internal" href="notebooks/Categorical.html">Categorical Programming</a></li>
177 <li class="toctree-l2"><a class="reference internal" href="notebooks/The_Four_Operations.html">The Four Fundamental Operations of Definite Action</a></li>
178 <li class="toctree-l2"><a class="reference internal" href="notebooks/Derivatives_of_Regular_Expressions.html">∂RE</a></li>
179 </ul>
180 </li>
181 </ul>
182 </div>
183 </section>
184 </section>
185 <section id="indices-and-tables">
186 <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
187 <ul class="simple">
188 <li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
189 <li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
190 <li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
191 </ul>
192 </section>
193
194
195           </div>
196           
197         </div>
198       </div>
199       <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
200         <div class="sphinxsidebarwrapper">
201 <h1 class="logo"><a href="#">Thun</a></h1>
202
203
204
205
206
207
208
209
210 <h3>Navigation</h3>
211 <ul>
212 <li class="toctree-l1"><a class="reference internal" href="notebooks/Intro.html">Thun: Joy in Python</a></li>
213 <li class="toctree-l1"><a class="reference internal" href="joy.html">Joy Interpreter</a></li>
214 <li class="toctree-l1"><a class="reference internal" href="stack.html">Stack or Quote or Sequence or List…</a></li>
215 <li class="toctree-l1"><a class="reference internal" href="parser.html">Parsing Text into Joy Expressions</a></li>
216 <li class="toctree-l1"><a class="reference internal" href="pretty.html">Tracing Joy Execution</a></li>
217 <li class="toctree-l1"><a class="reference internal" href="library.html">Function Reference</a></li>
218 <li class="toctree-l1"><a class="reference internal" href="lib.html">Functions Grouped by, er, Function with Examples</a></li>
219 <li class="toctree-l1"><a class="reference internal" href="types.html">Type Inference of Joy Expressions</a></li>
220 <li class="toctree-l1"><a class="reference internal" href="notebooks/index.html">Essays about Programming in Joy</a></li>
221 </ul>
222
223 <div class="relations">
224 <h3>Related Topics</h3>
225 <ul>
226   <li><a href="#">Documentation overview</a><ul>
227       <li>Next: <a href="notebooks/Intro.html" title="next chapter">Thun: Joy in Python</a></li>
228   </ul></li>
229 </ul>
230 </div>
231 <div id="searchbox" style="display: none" role="search">
232   <h3 id="searchlabel">Quick search</h3>
233     <div class="searchformwrapper">
234     <form class="search" action="search.html" method="get">
235       <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
236       <input type="submit" value="Go" />
237     </form>
238     </div>
239 </div>
240 <script>$('#searchbox').show(0);</script>
241
242
243
244
245
246
247
248
249         </div>
250       </div>
251       <div class="clearer"></div>
252     </div>
253     <div class="footer" role="contentinfo">
254 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">
255 <img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" />
256 </a>
257 <br />
258 <span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">Thun Documentation</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://joypy.osdn.io/" property="cc:attributionName" rel="cc:attributionURL">Simon Forman</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.<br />Based on a work at <a xmlns:dct="http://purl.org/dc/terms/" href="https://osdn.net/projects/joypy/" rel="dct:source">https://osdn.net/projects/joypy/</a>.
259       Created using <a href="http://sphinx-doc.org/">Sphinx</a> 4.3.0.
260     </div>
261
262   </body>
263 </html>