Commits

Anonymous committed 48d2bee Draft

Convert documentation to Markdown.

Comments (0)

Files changed (2)

+The Whothm Drawing Language
+===========================
+
+Overview
+--------
+
+Whothm is a language for describing infinite two-colour bitmapped
+graphics.
+
+### Prerequisites
+
+I'd love to tell you about Whothm, but first I need to tell you about
+Joanie, the Gnostic Babysitter. Have you seen her? She's a very normal
+twelve-year-old girl, with very normal twelve-year-old girl concerns —
+she worries if her friends will make fun of her for liking different
+music than they do, worries if that cute boy in home room likes her or
+not, worries if she'll be able to achieve a transcendant state of gnosis
+at the moment of her physical death so that her soul may be freed from
+the reincarnation cycle. Because, you see, she's a Gnostic. Not just
+curious about Gnosticism, not just going through a phase, or anything
+like that — Joanie is a die-hard, demiurge-rejecting,
+rotten-material-world-shunning Gnostic. And she charges $15 an hour.
+
+OK, *now* I can tell you about Whothm.
+
+### Program Structure
+
+Each Whothm program consists of a variable declaration section and a
+single infinite loop.
+
+There are two possible data types for variables: rectangles and truth
+tables. A rectangle is a structure of four integer members called x, y,
+w and h. A truth table is a map from pairs of boolean values to a single
+boolean value. A truth table is denoted by listing only the pairs which
+evaluate to true; all other pairs evaluate to false.
+
+Inside the infinite loop, there are two kinds of commands: draw commands
+and delta commands. Draw commands apply a rectangle to the drawing
+canvas. Every pixel on the canvas that lies within w pixels to the right
+of the x position, and within h pixels to the bottom of the y position,
+is changed. A truth table is given that determines how it is changed.
+The existing pixel is looked up in the first column of the table, and
+the pixel in the rectangle being drawn (which is always true) is looked
+up in the second column; the resulting pixel state is read off the third
+column. Truth maps to the foreground colour (typically black), while
+falsehood maps to the background colour (typically white.)
+
+Delta commands alter a named member of a named rectangle. They always
+add a value to the member, although that value may be negative. The
+value may be a literal constant, or it may be the current value of a
+named member of a named rectangle.
+
+Syntax
+------
+
+### Grammar
+
+    Whothm      ::= {Declaration ";"} "begin" {Command ";"} "end".
+    Declaration ::= Name<new> ":=" (RectDecl | TableDecl).
+    RectDecl    ::= "(" IntLit "," IntLit "," IntLit "," IntLit ")".
+    TableDecl   ::= TruthPair {"/" TruthPair}.
+    TruthPair   ::= "TT" | "TF" | "FT" | "FF".
+    Command     ::= DrawCmd | DeltaCmd.
+    DrawCmd     ::= "draw" Name<Rect> "," Name<Table>.
+    DeltaCmd    ::= MemberRef "+=" (IntLit | MemberRef).
+    MemberRef   ::= Name<Rect> "." RectMember.
+    RectMember  ::= "x" | "y" | "w" | "h".
+
+### Example Program
+
+    r := (0, 0, 1, 2);
+
+    AND := TT;
+    OR := TT/TF/FT;
+    NAND := TF/FT/FF;
+    NOR := FF;
+    XOR := TF/FT;
+
+    begin
+    r.x += 5;
+    r.y += r.w;
+    draw r, XOR;
+    end
+
+Semantics
+---------
+
+The meaning of a Whothm program is fairly intuitive. The commands
+between the `begin` and `end` are executed in sequence, altering the
+state of the drawing canvas, and of one or more rectangles. (There is no
+way to alter a truth table, once defined.) The whole sequence of
+commands is then repeated, *ad infinitum*.
+
+However, note that Whothm is a language for describing only shapes which
+are (countably) infinte in extent. For this reason, it is an error for
+the state of the program (that is, the variables and the canvas) to be
+the same on any two (even non-consecutive) iterations of the loop.
+
+Discussion
+----------
+
+Whothm raises some interesting questions, although not perhaps as
+interesting as those raised by Joanie's grades this semester. The main
+one is, what kinds of shapes can Whothm describe?
+
+Clearly, the shapes cannot be chaotic in any strong sense, as the
+equations involved are essentially linear. The sole exception is when a
+truth tables like XOR, which can reverse previous pixels, is used. In
+fact, the presence of XOR means that Whothm can generate infinite
+drawings without a fixed point. (XOR seems a bit like sine in that
+respect; you can't take the indefinite integral of it, because never
+ever settles down.) Yet, I believe it is not necessary — any shape that
+can be drawn with XOR can be drawn with suitable monotonic truth tables,
+as well.
+
+Further, despite not being able to produce clearly chaotic drawings,
+Whothm can still produce what are in my opinion somewhat pretty ones.
+
+Cat's Eye Technologies' implementation of Whothm is called JWhothm, as
+it is written in Java. Using a browser which supports Java applets, it
+can be interacted with in the [JWhothm
+exhibit](http://catseye.tc/gallery/esolangs/jwhothm/) in the [Gallery of
+Interactive Esolangs](http://catseye.tc/gallery/esolangs/).
+
+Happy infinite drawing!  
+Chris Pressey  
+June 29, 2010  
+Evanston, IL  
+Birthplace of Donald Rumsfeld... and Grace Slick

doc/whothm.html

-<?xml version="1.0"?>
-<!-- encoding: UTF-8 -->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
-<head>
-<title>The Whothm Drawing Language</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-  <!-- begin html doc dynamic markup -->
-  <script type="text/javascript" src="/contrib/jquery-1.6.4.min.js"></script>
-  <script type="text/javascript" src="/scripts/documentation.js"></script>
-  <!-- end html doc dynamic markup -->
-</head>
-<body>
-
-<h1>The Whothm Drawing Language</h1>
-
-<h2>Overview</h2>
-
-<p><dfn>Whothm</dfn> is a language for describing infinite two-colour bitmapped graphics.</p>
-
-<h3>Prerequisites</h3>
-
-<p>I'd love to tell you about Whothm, but first I need to tell you about Joanie, the Gnostic Babysitter.
-Have you seen her?  She's a very normal twelve-year-old girl, with very normal twelve-year-old girl
-concerns — she worries if her friends will make fun of her for liking different music than they do,
-worries if that cute boy in home room likes her or not, worries if she'll be able to achieve a
-transcendant state of gnosis at the moment of her physical death so that her soul may be freed from
-the reincarnation cycle.  Because, you see, she's a Gnostic.  Not just curious about Gnosticism,
-not just going through a phase, or anything like that — Joanie is a die-hard, demiurge-rejecting,
-rotten-material-world-shunning Gnostic.  And she charges $15 an hour.</p>
-
-<p>OK, <em>now</em> I can tell you about Whothm.</p>
-
-<h3>Program Structure</h3>
-
-<p>Each Whothm program consists of a variable declaration section and a single infinite loop.</p>
-
-<p>There are two possible data types for variables: rectangles and truth tables.
-A <dfn>rectangle</dfn> is a structure of four integer members called
-<var>x</var>, <var>y</var>, <var>w</var> and <var>h</var>.
-A <dfn>truth table</dfn> is a map from pairs of boolean values to a single boolean value.
-A truth table is denoted by listing only the pairs which evaluate to true; all other
-pairs evaluate to false.</p>
-
-<p>Inside the infinite loop, there are two kinds of commands: draw commands and delta commands.
-Draw commands apply a rectangle to the drawing canvas.  Every pixel on the canvas that lies within
-<var>w</var> pixels to the right of the <var>x</var> position, and within <var>h</var> pixels to
-the bottom of the <var>y</var> position, is changed.  A truth table is given that determines how it is
-changed.  The existing pixel is looked up in the first column of the table, and the pixel in the
-rectangle being drawn (which is always true) is looked up in the second column; the resulting
-pixel state is read off the third column.  Truth maps to the foreground colour (typically black), while
-falsehood maps to the background colour (typically white.)</p>
-
-<p>Delta commands alter a named member of a named rectangle.  They always add a value to
-the member, although that value may be negative.  The value may be a literal constant, or it
-may be the current value of a named member of a named rectangle.</p>
-
-<h2>Syntax</h2>
-
-<h3>Grammar</h3>
-
-<pre>
-Whothm      ::= {Declaration ";"} "begin" {Command ";"} "end".
-Declaration ::= Name&lt;new&gt; ":=" (RectDecl | TableDecl).
-RectDecl    ::= "(" IntLit "," IntLit "," IntLit "," IntLit ")".
-TableDecl   ::= TruthPair {"/" TruthPair}.
-TruthPair   ::= "TT" | "TF" | "FT" | "FF".
-Command     ::= DrawCmd | DeltaCmd.
-DrawCmd     ::= "draw" Name&lt;Rect&gt; "," Name&lt;Table&gt;.
-DeltaCmd    ::= MemberRef "+=" (IntLit | MemberRef).
-MemberRef   ::= Name&lt;Rect&gt; "." RectMember.
-RectMember  ::= "x" | "y" | "w" | "h".
-</pre>
-
-<h3>Example Program</h3>
-
-<pre>
-r := (0, 0, 1, 2);
-
-AND := TT;
-OR := TT/TF/FT;
-NAND := TF/FT/FF;
-NOR := FF;
-XOR := TF/FT;
-
-begin
-r.x += 5;
-r.y += r.w;
-draw r, XOR;
-end
-</pre>
-
-<h2>Semantics</h2>
-
-<p>The meaning of a Whothm program is fairly intuitive.  The commands between
-the <code>begin</code> and <code>end</code> are executed in sequence, altering
-the state of the drawing canvas, and of one or more rectangles.  (There is no
-way to alter a truth table, once defined.)  The whole sequence of commands
-is then repeated, <i>ad infinitum</i>.</p>
-
-<p>However, note that Whothm is a language for describing only shapes which are
-(countably) infinte in extent.  For this reason, it is an error for the state of the
-program (that is, the variables and the canvas) to be the same on any two
-(even non-consecutive) iterations of the loop.</p>
-
-<h2>Discussion</h2>
-
-<p>Whothm raises some interesting questions, although not perhaps as
-interesting as those raised by Joanie's grades this semester.  The main one is,
-what kinds of shapes can Whothm describe?</p>
-
-<p>Clearly, the shapes cannot be chaotic in
-any strong sense, as the equations involved are essentially linear.  The sole
-exception is when a truth tables like XOR, which can reverse previous
-pixels, is used.  In fact, the presence of XOR means that Whothm can generate
-infinite drawings without a fixed point.
-(XOR seems a bit like sine in that respect; you can't take the indefinite
-integral of it, because never ever settles down.) Yet, I believe it is not
-necessary — any shape that can be drawn with XOR can be drawn with
-suitable monotonic truth tables, as well.</p>
-
-<p>Further, despite not being able to produce clearly chaotic drawings,
-Whothm can still produce what are in my opinion somewhat pretty ones.</p>
-
-<p>Cat's Eye Technologies' implementation of Whothm is called JWhothm, as it
-is written in Java.  Using a browser which supports Java applets,
-it can be interacted with in the <a href="http://catseye.tc/gallery/esolangs/jwhothm/">JWhothm exhibit</a>
-in the <a href="http://catseye.tc/gallery/esolangs/">Gallery of Interactive Esolangs</a>.</p>
-
-<p>Happy infinite drawing!
-<br/>Chris Pressey
-<br/>June 29, 2010
-<br/>Evanston, IL
-<br/>Birthplace of Donald Rumsfeld... and Grace Slick</p>
-
-</body>
-</html>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.