minor cleanup

This commit is contained in:
Simon Forman 2023-02-10 08:09:31 -08:00
parent acfa19239e
commit 75591f36ba
5 changed files with 35 additions and 5 deletions

View File

@ -1,8 +1,8 @@
import sys import sys
import markdown import markdown
filename = '/usr/home/sforman/src/Joypy/README.md' #filename = '/usr/home/sforman/src/Joypy/README.md'
##filename = sys.argv[-1] filename = sys.argv[-1]
with open(filename) as f: with open(filename) as f:
text = f.read() text = f.read()

View File

@ -112,6 +112,7 @@ Functions receive the current stack, expression, and dictionary and return the n
<p>The <strong>dictionary</strong> associates symbols (strings) with Joy expressions that define the <p>The <strong>dictionary</strong> associates symbols (strings) with Joy expressions that define the
available functions of the Joy system. Together the stack, expression, and dictionary available functions of the Joy system. Together the stack, expression, and dictionary
are the entire state of the Joy interpreter.</p> are the entire state of the Joy interpreter.</p>
<h3>Interpreter</h3>
<p><img alt="joy_interpreter_flowchart.svg" src="/joy_interpreter_flowchart.svg"></p> <p><img alt="joy_interpreter_flowchart.svg" src="/joy_interpreter_flowchart.svg"></p>
<h3>Stack / Quote / List / Sequence</h3> <h3>Stack / Quote / List / Sequence</h3>
<p>When talking about Joy we use the terms "stack", "quote", "sequence", <p>When talking about Joy we use the terms "stack", "quote", "sequence",
@ -129,7 +130,7 @@ All these I call literals because their occurrence in code results in
them being pushed onto the stack. But I also call [London Paris] a list. them being pushed onto the stack. But I also call [London Paris] a list.
So, [dup *] is a quotation but not a list.</p> So, [dup *] is a quotation but not a list.</p>
</blockquote> </blockquote>
<p>From ["A Conversation with Manfred von Thun" w/ Stevan Apter](http://archive.vector.org.uk/art10000350</p> <p>From <a href="http://archive.vector.org.uk/art10000350">"A Conversation with Manfred von Thun" w/ Stevan Apter</a></p>
<h3>Literals and Simple Functions</h3> <h3>Literals and Simple Functions</h3>
<p>TODO</p> <p>TODO</p>
<h3>Combinators</h3> <h3>Combinators</h3>

View File

@ -1,5 +1,5 @@
FUNCDOCS = $(wildcard ../*.md) FUNCDOCS = $(wildcard ../*.md)
TITLE = --metadata title="Function Reference" TITLE = --metadata title="Thun Function Reference"
TOC = --toc --toc-depth=2 TOC = --toc --toc-depth=2
all: mov all: mov

View File

@ -68,7 +68,7 @@ popopd [popop] dip
popopdd [popop] dipd popopdd [popop] dipd
product 1 swap [*] step product 1 swap [*] step
quoted [unit] dip quoted [unit] dip
range [0 <=] [1 - dup] anamorphism range [0 <=] [-- dup] anamorphism
range_to_zero unit [down_to_zero] infra range_to_zero unit [down_to_zero] infra
reco rest cons reco rest cons
reverse <{} shunt reverse <{} shunt

View File

@ -1,3 +1,32 @@
>>> 23 * 12345.6789
283950.61470000003
joy? 23 123456789 *
2839506147
joy? 10000 /
283950
eh?
See that "0000003" at the end of the float?
Floating point numbers /suck/, we only use them because
computers were small and slow. Now that they are large
(sixty-four bits per word!? Holy shit!) and fast, so
floating point is no longer necessary.
(However, in practice, we will still be using it, because
it's been turd-polished to such a high sheen. GPUs are
monsters! But most of us have no use for supercomputers
outside of playing fancy games.)
---------------------------------------
With a little bit of complexity we could improve efficiency (e.g. using With a little bit of complexity we could improve efficiency (e.g. using
VList instead of singly-linked list.) But I want to tackle efficiency by VList instead of singly-linked list.) But I want to tackle efficiency by
compilation, and write the compiler(s) in Prolog. I think that avoids compilation, and write the compiler(s) in Prolog. I think that avoids