I've added cond and cmp to the library so that should bump the minor version no. I think. |
||
|---|---|---|
| .. | ||
| Advent of Code 2017 December 3rd_files | ||
| jupyter_kernel | ||
| sphinx_docs | ||
| 0. This Implementation of Joy in Python.html | ||
| 0. This Implementation of Joy in Python.ipynb | ||
| 0. This Implementation of Joy in Python.md | ||
| 0. This Implementation of Joy in Python.rst | ||
| 1. Basic Use of Joy in a Notebook.html | ||
| 1. Basic Use of Joy in a Notebook.ipynb | ||
| 1. Basic Use of Joy in a Notebook.md | ||
| 1. Basic Use of Joy in a Notebook.rst | ||
| 2. Library Examples.html | ||
| 2. Library Examples.ipynb | ||
| 2. Library Examples.md | ||
| 2. Library Examples.rst | ||
| 3. Developing a Program.html | ||
| 3. Developing a Program.ipynb | ||
| 3. Developing a Program.md | ||
| 3. Developing a Program.rst | ||
| 4. Replacing Functions in the Dictionary.html | ||
| 4. Replacing Functions in the Dictionary.ipynb | ||
| 4. Replacing Functions in the Dictionary.md | ||
| 4. Replacing Functions in the Dictionary.rst | ||
| Advent of Code 2017 December 1st.html | ||
| Advent of Code 2017 December 1st.ipynb | ||
| Advent of Code 2017 December 1st.md | ||
| Advent of Code 2017 December 1st.rst | ||
| Advent of Code 2017 December 2nd.html | ||
| Advent of Code 2017 December 2nd.ipynb | ||
| Advent of Code 2017 December 2nd.md | ||
| Advent of Code 2017 December 2nd.rst | ||
| Advent of Code 2017 December 3rd.html | ||
| Advent of Code 2017 December 3rd.ipynb | ||
| Advent of Code 2017 December 3rd.md | ||
| Advent of Code 2017 December 3rd.rst | ||
| Advent of Code 2017 December 4th.html | ||
| Advent of Code 2017 December 4th.ipynb | ||
| Advent of Code 2017 December 4th.md | ||
| Advent of Code 2017 December 4th.rst | ||
| Advent of Code 2017 December 5th.html | ||
| Advent of Code 2017 December 5th.ipynb | ||
| Advent of Code 2017 December 5th.md | ||
| Advent of Code 2017 December 5th.rst | ||
| Advent of Code 2017 December 6th.html | ||
| Advent of Code 2017 December 6th.ipynb | ||
| Advent of Code 2017 December 6th.md | ||
| Advent of Code 2017 December 6th.rst | ||
| Document.md | ||
| Generator Programs.html | ||
| Generator Programs.ipynb | ||
| Generator Programs.md | ||
| Generator Programs.rst | ||
| Hylo-, Ana-, Cata-, and Para-morphisms - Recursion Combinators.html | ||
| Hylo-, Ana-, Cata-, and Para-morphisms - Recursion Combinators.ipynb | ||
| Hylo-, Ana-, Cata-, and Para-morphisms - Recursion Combinators.md | ||
| Hylo-, Ana-, Cata-, and Para-morphisms - Recursion Combinators.rst | ||
| Library Examples.pdf | ||
| Newton-Raphson.html | ||
| Newton-Raphson.ipynb | ||
| Newton-Raphson.md | ||
| Newton-Raphson.rst | ||
| Ordered_Binary_Trees.html | ||
| Ordered_Binary_Trees.ipynb | ||
| Ordered_Binary_Trees.md | ||
| Ordered_Binary_Trees.rst | ||
| Quadratic.html | ||
| Quadratic.ipynb | ||
| Quadratic.md | ||
| Quadratic.rst | ||
| README.md | ||
| Trees.html | ||
| Trees.ipynb | ||
| Trees.md | ||
| Trees.rst | ||
| Treestep.html | ||
| Treestep.ipynb | ||
| Treestep.md | ||
| Treestep.rst | ||
| Zipper.html | ||
| Zipper.ipynb | ||
| Zipper.md | ||
| Zipper.rst | ||
| notebook_preamble.py | ||
| notebook_preamble.pyc | ||
| pe1.py | ||
| pe1.txt | ||
| repl.py | ||
README.md
Some Jupyter Notebooks and other material.
All of the notebooks are also available as HTML and Markdown files (generated using nbconvert) so you can view them without running Jupyter.
In order to run the Jupyter Notebooks you need Jupyter (obviously) and you should install Joypy. Here's an example using virtualenv from the joypy/ directory:
virtualenv --system-site-packages <DIRNAME>
. ./<DIRNAME>/bin/activate
python ./setup.py install
Once that's done you should be able to start Jupyter Notebook server with, e.g.:
python -n notebook
This starts it using the virtualenv version of Python so joy will be available. Navigate to the joypy/docs directory and the notebooks should be able to import the notebook_preamble.py file.
Table of Contents
-
- Basic Use of Joy in a Notebook
-
- Library Examples - Short examples of each word in the dictionary. Various formats.
-
- 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.
-
- 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.