Thun/docs
Simon Forman 5d856bf444 I think the real solution is to "not do that" as it were.
Unquoted symbols on the stack are verboten.
2021-11-28 15:03:47 -08:00
..
Advent_of_Code_2017_December_3rd_files Make cannot deal with spaces in filenames. 2018-06-06 12:57:12 -07:00
dep-graphs Move VUI package/module graph. 2019-05-07 10:00:52 -07:00
jupyter_kernel Joy Jupyter kernel loads defs.txt 2021-11-25 11:12:02 -08:00
sphinx_docs Bleah. 2021-11-27 10:31:32 -08:00
with_sympy_files A bunch of docs. 2018-08-24 16:48:15 -07:00
0._This_Implementation_of_Joy_in_Python.html Update some of the docs. 2020-05-20 19:15:47 -07:00
0._This_Implementation_of_Joy_in_Python.ipynb Updating the first notebook. 2021-11-23 10:11:46 -08:00
0._This_Implementation_of_Joy_in_Python.md Update some of the docs. 2020-05-20 19:15:47 -07:00
0._This_Implementation_of_Joy_in_Python.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
1._Basic_Use_of_Joy_in_a_Notebook.html Update some of the docs. 2020-05-20 19:15:47 -07:00
1._Basic_Use_of_Joy_in_a_Notebook.ipynb Using Jupyter. 2021-11-23 11:28:17 -08:00
1._Basic_Use_of_Joy_in_a_Notebook.md Update some of the docs. 2020-05-20 19:15:47 -07:00
1._Basic_Use_of_Joy_in_a_Notebook.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
2._Library_Examples.html Update some of the docs. 2020-05-20 19:15:47 -07:00
2._Library_Examples.ipynb Update some of the docs. 2020-05-20 19:15:47 -07:00
2._Library_Examples.md Update some of the docs. 2020-05-20 19:15:47 -07:00
2._Library_Examples.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
3._Developing_a_Program.html Update some of the docs. 2020-05-20 19:15:47 -07:00
3._Developing_a_Program.ipynb Updating the docs. Playing with Joy Kernel. 2021-11-24 08:54:08 -08:00
3._Developing_a_Program.md Update some of the docs. 2020-05-20 19:15:47 -07:00
3._Developing_a_Program.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_1st.html Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_1st.ipynb Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_1st.md Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_1st.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_2nd.html Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_2nd.ipynb Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_2nd.md Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_2nd.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_3rd.html Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_3rd.ipynb Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_3rd.md Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_3rd.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_4th.html Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_4th.ipynb Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_4th.md Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_4th.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_5th.html Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_5th.ipynb Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_5th.md Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_5th.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_6th.html Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_6th.ipynb Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_6th.md Update some of the docs. 2020-05-20 19:15:47 -07:00
Advent_of_Code_2017_December_6th.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
Compiling_Joy.html Update some of the docs. 2020-05-20 19:15:47 -07:00
Compiling_Joy.ipynb Update some of the docs. 2020-05-20 19:15:47 -07:00
Compiling_Joy.md Update some of the docs. 2020-05-20 19:15:47 -07:00
Compiling_Joy.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
Correcet_Programming.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Correcet_Programming.ipynb I just want to publish this right quick. 2018-08-24 17:05:42 -07:00
Correcet_Programming.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Correcet_Programming.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Derivatives_of_Regular_Expressions.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Derivatives_of_Regular_Expressions.ipynb Minor docs update. 2020-04-25 14:14:35 -07:00
Derivatives_of_Regular_Expressions.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Derivatives_of_Regular_Expressions.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Document.md Some docs that got swept up in the commotion. 2018-06-06 13:08:04 -07:00
Generator_Programs.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Generator_Programs.ipynb A bit more docs. 2018-07-14 12:07:49 -07:00
Generator_Programs.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Generator_Programs.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Hylo-,_Ana-,_Cata-,_and_Para-morphisms_-_Recursion_Combinators.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Hylo-,_Ana-,_Cata-,_and_Para-morphisms_-_Recursion_Combinators.ipynb The Hylos notebook is not ready for public yet. 2018-06-08 13:05:59 -07:00
Hylo-,_Ana-,_Cata-,_and_Para-morphisms_-_Recursion_Combinators.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Hylo-,_Ana-,_Cata-,_and_Para-morphisms_-_Recursion_Combinators.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Joy in Jupyter.ipynb Updating the docs. Playing with Joy Kernel. 2021-11-24 08:54:08 -08:00
Library_Examples.pdf Make cannot deal with spaces in filenames. 2018-06-06 12:57:12 -07:00
Makefile A little more bit o' docs. 2018-07-14 12:29:25 -07:00
Multiples of 3 and 5.ipynb Updating the docs. Playing with Joy Kernel. 2021-11-24 08:54:08 -08:00
Newton-Raphson.html Update some of the docs. 2020-05-20 19:15:47 -07:00
Newton-Raphson.ipynb Just playing around. 2021-11-24 14:53:26 -08:00
Newton-Raphson.md Update some of the docs. 2020-05-20 19:15:47 -07:00
Newton-Raphson.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
Ordered_Binary_Trees.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Ordered_Binary_Trees.ipynb The version of Python with Anaconda is lightly newer. 2018-08-24 16:46:18 -07:00
Ordered_Binary_Trees.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Ordered_Binary_Trees.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Quadratic.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Quadratic.ipynb The version of Python with Anaconda is lightly newer. 2018-08-24 16:46:18 -07:00
Quadratic.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Quadratic.rst Rebuild docs 2020-05-17 16:40:58 -07:00
README.md backup-and-remove-htdocs script doc. 2021-11-25 09:33:09 -08:00
Recursion_Combinators.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Recursion_Combinators.ipynb The version of Python with Anaconda is lightly newer. 2018-08-24 16:46:18 -07:00
Recursion_Combinators.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Recursion_Combinators.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Replacing.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Replacing.ipynb Rebuild html. 2018-06-08 13:17:36 -07:00
Replacing.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Replacing.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Square_Spiral.html Update Square_Spiral notebook to use Joy kernel 2021-11-27 17:04:15 -08:00
Square_Spiral.ipynb Update Square_Spiral notebook to use Joy kernel 2021-11-27 17:04:15 -08:00
Square_Spiral.md Update Square_Spiral notebook to use Joy kernel 2021-11-27 17:04:15 -08:00
Square_Spiral.rst Update Square_Spiral notebook to use Joy kernel 2021-11-27 17:04:15 -08:00
The_Four_Operations.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
The_Four_Operations.ipynb A little more documentation. 2018-07-11 07:13:05 -07:00
The_Four_Operations.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
The_Four_Operations.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Trees.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Trees.ipynb Fixes #38237 Sort out stack/unstack/enstacken/disenstacken 2020-04-28 10:42:09 -07:00
Trees.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Trees.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Treestep.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Treestep.ipynb Bumped version to 0.2.0; docs edits. 2018-06-06 08:47:26 -07:00
Treestep.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Treestep.rst Rebuild docs 2020-05-17 16:40:58 -07:00
TypeChecking.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
TypeChecking.ipynb Finally remove all mentions of the old polytypes module. 2020-04-25 15:59:31 -07:00
TypeChecking.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
TypeChecking.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Types.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Types.ipynb Finally remove all mentions of the old polytypes module. 2020-04-25 15:59:31 -07:00
Types.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Types.rst Rebuild docs 2020-05-17 16:40:58 -07:00
Zipper.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Zipper.ipynb I think the real solution is to "not do that" as it were. 2021-11-28 15:03:47 -08:00
Zipper.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
Zipper.rst Rebuild docs 2020-05-17 16:40:58 -07:00
bug.txt Working on bug #15 2021-11-25 11:52:06 -08:00
fun_with_scan.html Update some of the docs. 2020-05-20 19:15:47 -07:00
fun_with_scan.ipynb Update some of the docs. 2020-05-20 19:15:47 -07:00
fun_with_scan.md Update some of the docs. 2020-05-20 19:15:47 -07:00
fun_with_scan.rst Update some of the docs. 2020-05-20 19:15:47 -07:00
notebook_preamble.py Minor cleanup. 2020-05-20 15:34:30 -07:00
pe1.py Initial move of code from git repo. 2018-04-14 18:13:13 -07:00
pe1.txt Initial move of code from git repo. 2018-04-14 18:13:13 -07:00
repl.py Rename primrec to tailrec. 2020-04-28 11:05:19 -07:00
unbug.txt Working on bug #15 2021-11-25 11:52:06 -08:00
with_sympy.html Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
with_sympy.ipynb A bunch of docs. 2018-08-24 16:48:15 -07:00
with_sympy.md Rebuild docs with Python 3 and Sphinx 3.0.2. 2020-04-28 15:37:49 -07:00
with_sympy.rst Rebuild docs 2020-05-17 16:40:58 -07:00

README.md

Thun Documentation Documentation

Most of the docs take the form of some Jupyter notebooks.

The notebooks are converted (using nbconvert) to HTML, Markdown, and ReST files so you can view them without running Jupyter.

Running the Notebooks with Jupyter

In order to run the Jupyter notebooks you need Jupyter (obviously):

Installing the classic Jupyter Notebook interface

And, of course, you should install Thun (see the main project README or the online docs).

Once that's done you should be able to start Jupyter Notebook server in the joypy/docs directory and run the notebooks.

notebook_preamble.py

...something about the notebook_preamble.py file.

Installing the Joy Jupyter Kernel

Joy Jupyter Kernel

Tracking down the deets:

From Making simple Python wrapper kernels:

Now create a JSON kernel spec file and install it using jupyter kernelspec install </path/to/kernel>. Place your kernel module anywhere Python can import it (try current directory for testing).

The current list of kernels:

% jupyter kernelspec list
Available kernels:
  python3    /usr/home/sforman/.local/share/jupyter/kernels/python3

Place your kernel module anywhere Python can import it

Yah, okay.

sforman@bock:~/src/Joypy/docs/jupyter_kernel % setenv PYTHONPATH `pwd`

Let's go!

sforman@bock:~/src/Joypy/docs/jupyter_kernel % jupyter kernelspec install .
[Errno 13] Permission denied: '/usr/local/share/jupyter'
Perhaps you want to install with `sudo` or `--user`?

Okay

sforman@bock:~/src/Joypy/docs/jupyter_kernel % jupyter kernelspec install --user .
[InstallKernelSpec] Removing existing kernelspec in /usr/home/sforman/.local/share/jupyter/kernels/.
Traceback (most recent call last):
  File "/home/sforman/.local/bin/jupyter-kernelspec", line 8, in <module>
    sys.exit(KernelSpecApp.launch_instance())
  File "/home/sforman/.local/lib/python3.7/site-packages/traitlets/config/application.py", line 846, in launch_instance
    app.start()
  File "/home/sforman/.local/lib/python3.7/site-packages/jupyter_client/kernelspecapp.py", line 323, in start
    return self.subapp.start()
  File "/home/sforman/.local/lib/python3.7/site-packages/jupyter_client/kernelspecapp.py", line 151, in start
    replace=self.replace,
  File "/home/sforman/.local/lib/python3.7/site-packages/jupyter_client/kernelspec.py", line 404, in install_kernel_spec
    shutil.rmtree(destination)
  File "/usr/local/lib/python3.7/shutil.py", line 498, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/usr/local/lib/python3.7/shutil.py", line 496, in rmtree
    os.rmdir(path)
OSError: [Errno 22] Invalid argument: '/usr/home/sforman/.local/share/jupyter/kernels/.'

Looks at code Oh FFS

cp -Rv /usr/home/sforman/src/Joypy/docs/jupyter_kernel /usr/home/sforman/.local/share/jupyter/kernels/thun

/usr/home/sforman/src/Joypy/docs/jupyter_kernel -> /usr/home/sforman/.local/share/jupyter/kernels/thun
/usr/home/sforman/src/Joypy/docs/jupyter_kernel/Try out the Joypy Jupyter Kernel.ipynb -> /usr/home/sforman/.local/share/jupyter/kernels/thun/Try out the Joypy Jupyter Kernel.ipynb
/usr/home/sforman/src/Joypy/docs/jupyter_kernel/joy_kernel.py -> /usr/home/sforman/.local/share/jupyter/kernels/thun/joy_kernel.py
/usr/home/sforman/src/Joypy/docs/jupyter_kernel/kernel.json -> /usr/home/sforman/.local/share/jupyter/kernels/thun/kernel.json

Done. Can start joy kernal notebooks.

Building and Uploading

This section is mostly for my own reference.

backup-and-remove-htdocs script

On the OSDN server I have a little script I call backup-and-remove-htdocs which does exactly what it says. Here are the current contents:

#!/usr/bin/env bash
tar cvz --remove-files \
  -f $HOME/site-backup-$(date -u +'%F-%T').tgz \
  /home/groups/j/jo/joypy/htdocs/*

As you can see, all it does is move the existing site into a tarball (in case I want to refer to it later for some reason.) Every once in a while they should be cleared out.

The main Makefile uses this script via ssh then uses rsync to upload the new version of the site.

Table of Contents

    1. Basic Use of Joy in a Notebook
    1. Library Examples - Short examples of each word in the dictionary. Various formats.
    1. Developing a Program - Working with the first problem from Project Euler, "Find the sum of all the multiples of 3 or 5 below 1000", several forms of the program are derived.
    1. Replacing Functions in the Dictionary - Shows the basics of defining new "primitive" functions in Python or as definitions and adding them to the dictionary.
  • Factorial Function and Paramorphisms - A basic pattern of recursive control-flow.
  • Generator Programs - Using the x combinator to make generator programs which can be used to create unbounded streams of values.
  • Hylo-, Ana-, Cata-morphisms - Some basic patterns of recursive control-flow structures.
  • Quadratic - Not-so-annoying Quadratic Formula.
  • Trees - Ordered Binary Trees in Joy and more recursion.
  • Zipper - A preliminary examination of the idea of data-structure "zippers" for traversing datastructures.
  • notebook_preamble.py - Imported into notebooks to simplify the preamble code.
  • pe1.py pe1.txt - Set up and execute a Joy program for the first problem from Project Euler. The pe1.txt file is the trace. It's 2.8M uncompressed. Compressed with gzip it becomes just 0.12M.
  • repl.py - Run this script to start a REPL. Useful for e.g. running Joy code in a debugger.

Notes

One of the things that interests me about Joy is how programming becomes less about writing code and more about sound reasoning about simple (almost geometric) programs. Many of the notebooks in this collection consist of several pages of discussion to arrive at a few lines of Joy definitions. I think this is a good thing. This is "literate programming". The "programs" resemble mathematical proofs. You aren't implementing so much as deriving. The structure of Joy seems to force you to think clearly about the task in a way that is reliable but extremely flexible. It feels like a puzzle game, and the puzzles are often simple, and the solutions build on each other.