Browse Source

Update specification.

* Specify a version
* Remove and resolve a few undecided points
* Formatting changes
master
Jeb Rosen 1 year ago
parent
commit
65b8f24ead
3 changed files with 58 additions and 21 deletions
  1. +1
    -1
      Cargo.toml
  2. +52
    -17
      README.html.sh
  3. +5
    -3
      presidents.tsv

+ 1
- 1
Cargo.toml View File

@@ -1,6 +1,6 @@
[package]
name = "washington"
version = "0.1.0"
version = "0.0.2"
authors = ["jeb <jeb@jebrosen.com>"]

[dependencies]

+ 52
- 17
README.html.sh View File

@@ -30,22 +30,37 @@ th, td {
border: 1px solid black;
padding: 4px 2px;
}

.code {
background-color: #333333;
color: #cccccc;
padding: 0.5em;
border-radius: 4px;
margin-right: auto;
}
</style>
</head>

<body>
<h1>The Washington Programming Language</h1>

<em>Washington Tyler Lincoln Harrison VanBuren Tyler Adams Madison</em>
<p>Draft Specification; version 0.0.2</p>
<p>Author: Jeb Rosen &lt;jeb@jebrosen.com&gt;</p>

<h2>Overview</h2>
<p>
<em>Emphasized</em> text is uncertain and subject to change.
Washington exists because Pikachu is too difficult to use practically. To avoid
being too practical, however, Washington has several pointless and confusing
restrictions of its own.
</p>

<h2>General Syntax</h2>

<ul>
<li>A Nation is defined by a sequence of names of Presidents, some to be Inaugurated and some to be read as arguments for other Presidents.</li>
<li>
A Nation is defined by a sequence of names of Presidents, some to be
Inaugurated and some to be read as arguments for other Presidents.
</li>
<li>The names of Presidents are case-insensitive.</li>
<li>President names must be separated by any number of whitespace characters.</li>
<li>The comma, period, semicolon, colon, exclamation, and question mark characters are ignored.</li>
@@ -58,27 +73,49 @@ th, td {
<li>
Each inaugurated President must be from a different Party than the previously inaugurated President.
<ul>
<li>Democratic-Republicans count as both Democrats and Republicans, and must be preceded and/or followed only by a Federalist or a Whig.</li>
<li>
Democratic-Republicans count as both Democrats and Republicans, and
must be preceded and/or followed only by a Federalist or a Whig.
</li>
</ul>
</li>
<li>The last president named for possible inauguration determines the "era" of the Nation. Future Presidents (those from a later era) cannot be named. Presidents become more complex in later eras. If an ambiguous president is named in this manner, the earliest possible era is chosen. This last President will still be Inaugurated if reached during the life of the Nation.</li>
<li>In the case of an ambiguous name, it as if both Presidents were inaugurated simultaneously. If they are from different parties, both of their restrictions apply.</li>
<li>
The last president eligible for inauguration (i.e. not named as an
argument) determines the "era" of the Nation. Future Presidents (those from a
later era) cannot be named. Presidents become more complex in later eras. If
an ambiguous president is named in this manner, the earliest possible era is
chosen. This last President will still be Inaugurated if reached during the
life of the Nation.
</li>
<li>
In the case of an ambiguous name, it as if both Presidents were
inaugurated simultaneously. If they are from different parties, both of their
restrictions apply.
</li>
</ul>

<h2>Special Cases and Exceptions</h2>
<ul>
<li>John Adams is the only Federalist, but his last name conflicts with John Quincy Adams. To resolve this, the name "Adams" always refers to the Federalist John Adams, and "Quincy" always to the Democratic-Republican John Quincy Adams.</li>
<li>
John Adams is the only Federalist, but his last name conflicts with John
Quincy Adams. To resolve this, the name "Adams" always refers to the
Federalist John Adams, and "Quincy" always to the Democratic-Republican
John Quincy Adams.
</li>
<li>Van Buren's name is combined into one token, VanBuren.</li>
<li>Donald Trump is still in office, and is reserved for future expansion to the language.</li>
<li>
Donald Trump is still in office, and his name is reserved for future
expansion to the language.
</li>
</ul>

<h2>Inauguration Model</h2>

<p>
Some Presidents operate on registers, which are named after presidents.
Presidents that share names create ambiguity; generally, operations that
read data will use the earliest possible register and operations that
write data will affect both registers.
Presidents that share names create ambiguity; generally, inaugurations that
read data read from the earliest possible register and inaugurations that
write data will write to both registers.
</p>

<p>
@@ -92,18 +129,14 @@ Some Presidents operate on a stack, the top of which overlaps with the
registers. After pushing 3, 4, then 5 on the stack these values would
be visible in the Jefferson, Adams, and Washington registers
respectively. After popping two values off the stack, Washington would
hold the value 3. The stack can be assumed to be of infinite length,
hold the value 3. The stack should be assumed to be of infinite length,
though implementations will probably limit it.
</p>

<p>
<em>TODO: pushing/popping out of the register overlap region</em>
</p>

<h2>List of Presidents</h2>

<table>
$(awk -F'\t' '{ print "<tr><td>"$1"</td><td>"$2"</td><td>"$3"</td><td>"$4"</td><td>"$5"</td><td>"$6"</td></tr>" }' presidents.tsv)
$(awk -F'\t' '/\t/{ print "<tr><td>"$1"</td><td>"$2"</td><td>"$3"</td><td>"$4"</td><td>"$5"</td><td>"$6"</td></tr>" }' presidents.tsv)
</table>

<h2>Examples</h2>
@@ -130,6 +163,8 @@ $(include_code tests/loop.usa)
<dt>inaugurate</dt><dd>execute</dd>
</dl>

<p>Copyright © Jeb Rosen 2019.</p>

</body>
</html>
EOF


+ 5
- 3
presidents.tsv View File

@@ -22,11 +22,11 @@
21 Arthur Arthur, Chester R
22 Cleveland Cleveland, Grover D
23 Harrison Harrison, Benjamin R <em>same name as #9</em>
24 Cleveland Cleveland, Grover D <em>same name and real person as #22</em>
24 Cleveland Cleveland, Grover D <em>same name (and same person) as #22</em>
25 McKinley McKinley, William R
26 Roosevelt Roosevelt, Theodore R
27 Taft Taft, William Howard R
28 Wilson Wilson, Woodrow D <em>WWI?</em>
28 Wilson Wilson, Woodrow D
29 Harding Harding, Warren R
30 Coolidge Coolidge, Calvin R
31 Hoover Hoover, Herbert R
@@ -35,7 +35,7 @@
34 Eisenhower Eisenhower, Dwight R
35 Kennedy Kennedy, John D
36 Johnson Johnson, Lyndon D <em>same name as #17</em>
37 Nixon Nixon, Richard R <em>Illegal Instruction</em>
37 Nixon Nixon, Richard R Illegal instruction.
38 Ford Ford, Gerald R
39 Carter Carter, Jimmy D
40 Reagan Reagan, Ronald R
@@ -44,3 +44,5 @@
43 Bush Bush, George W. R <em>same name as #41</em>
44 Obama Obama, Barack D
45 Trump Trump, Donald R <em>Reserved instruction until out of office</em>

# vi: vts=3,15,25,8

Loading…
Cancel
Save