Site Logo

Announcing the Washington programming language

Every Nation must be founded by Washington.
- Washington programming language specification

Washington is a new programming language in which every token is the name of a United States President. Washington currently specifies a simultaneously register- and stack-based memory model and very rudimentary input and output support. The set of instructions available varies between Nations (programs), and some arbitrary restrictions are enforced based on the number of terms served by presidents and the political parties they belonged to.

Actions speak louder than words, so here is an annotated Hello World program written in Washington:

" Every nation must be founded by Washington.

" 'Jackson' increments the Washington register to 1.

" We want to inaugurate 'Jefferson' next, but Jefferson was a
" Democratic-Republican and Jackson was a Democrat. Both parties have
" "Democrat" in the name, so it is invalid to inaugurate one after the
" other.  Harrison was a Whig, so it is valid to inaugurate Harrison
" here.  Conveniently, 'Harrison' is a no-op because the real President
" Harrison died so early on in his term.

" 'Jefferson Washington' adds the value in the Washington register to
" the Washington register, effectively doubling it.
Jefferson Washington Harrison
Jefferson Washington Harrison
Jefferson Washington Harrison.

" 'Monroe Adams' stores the value in the Washington register (now 8) in
" the Adams register.
Monroe Adams Harrison
Jefferson Washington Harrison
Jefferson Washington Harrison.

" Store the value 32 in the Jefferson register, then double Washington
" one more time to 64.
Monroe Jefferson Harrison
Jefferson Washington Harrison.

" Add 8 (in Adams) to 64, then print the character 72 (ASCII 'H').
" 'Tyler' was a whig, and prints ASCII characters
Jefferson Adams Tyler

" 'VanBuren' decrements the Washington register, leading to
" 69 (ASCII 'E').
VanBuren Harrison VanBuren Harrison VanBuren Tyler

" 69 + 8 - 1 = 76 (ASCII 'L')
Jefferson Adams Harrison VanBuren Tyler

" Store 76 in Madison and print 'L' again.
Monroe Madison Tyler

" Increment 3 times to 79 and print 'O'
Jackson Harrison Jackson Harrison Jackson Tyler

" Store the value 79 in the Monroe register.
Monroe Monroe Harrison

" 'Quincy' loads the value in the given register into the Washington
" register. Jefferson contains 32 from earlier, which corresponds to
" ASCII ' ' (space).
Quincy Jefferson Tyler

" Load the value 79 back out of the Monroe register, add 8 (from the
" Adams register) = 87. Print 87 (ASCII 'W').
Quincy Monroe Harrison Jefferson Adams Tyler

" 'Madison' subtracts the value in the named register from the
" Washington register.
" Print 87 - 8 = 79 (ASCII 'O').
Madison Adams Tyler

" Increment 3 times to 82, and print ASCII 'R'.
Jackson Harrison Jackson Harrison Jackson Tyler

" Load 76 from Madison and print 'L'
Quincy Madison Tyler

" Subtract 8. 76 - 8 = 68 (ASCII 'D').
Madison Adams Tyler

" Load 32 from the Jefferson register, and add 1.
" 33 is the ASCII value of '!'.
Quincy Jefferson Harrison Jackson

" Tyler is the last president to be inaugurated. The last president in
" a Nation (program) determines its "Era", which is the last President
" whose name is allowed. It would be an error to name Polk in this
" program, because Polk served after Tyler.
The specification is still undergoing heavy modification, and only 15 Presidents have been defined. I hope to make a bigger announcement and publish a specification and implementation some time in the coming months.
Created 2018-08-09. Updated 2018-12-02.