Stroll
| Paradigm(s) | imperative |
|---|---|
| Designed by | User:Rottytooth |
| Appeared in | 2024 |
| Computational class | Turing complete |
| Reference implementation | Unimplemented |
| Influenced by | Taxi |
| File extension(s) | NONE |
Stroll is a programming language whose code is intimately tied to a physical neighborhood, usually (but not necessarily) urban. A Stroll program is written in walking instructions for three actors, called Red, Green, and Blue.
While the parts of Red and Green's code can be deciphered from afar with a map, the programmatic meaning of Blue's instructions can only be understood by walking the streets referred to in the Stroll program.
Language Basics
Since Stroll programs are written for people, its exact encoding can vary, so long as it includes:
- A series of walking instructions for Red, Green, and Blue, in the correct order
- A starting place for the three
- Some indication of Blue's lexicon, which can vary from program to program
Typically a Stroll program is written in a series of arrows, either drawn in red, green, and blue, or proceeded with 'R','G', and 'B'. Often a map of the streets walked in the program are included as well, with an arrow indicating the starting point and starting direction. In its place, a short script like "Starting on 75th and Madison, facing North" can work to indicate from where the walking instructions begin.
Syntax
Three Strollers
Red moves from intersection to intersection, one block at a time. Red is in charge of constants, which are determined by the name of the two streets. If a street has a number in its name, that is its value. If it does not, the number of characters in the name of the street is its value, minus "St", "Ave", etc (as appropriate for the local language).
Green moves from block to block. Each block is a memory cell, initialized to zero. Green can be thought of as a memory pointer.
Blue moves from intersection to intersection, but its value comes from local features of the block it has just walked. These features might be the number of windows on the first floor (more than twenty is not counted and just considered "a lot"). It could be the incline of the street, presence of potholes, or the species of trees that live on that street. Blue must encode their reasoning in the program for another Blue to decipher. Blue determines what action is performed. In some cases, Blue will have two movements in a command, creating more possibilities for how that command is encoded.
Sequence of motion
A vertical arrow (↑) indicates moving forward one block. Down (↓) indicates turning around; an alternative is ↷. Other arrows indicate turns, and need to be appropriate for the actual grid of the neighborhood. In an area with triangular blocks, more of a variety of arrows would be used if the simple left and right are not enough to make clear which turn is indicated.
Command Structure
The order the three Strollers move determines the command. There is no other indicator of the beginning or end of a command, so the sequence is very important.
| Sequence | Use |
|---|---|
| R G | A constant defined by R is assigned to a memory cell determined by G |
| R G B | Perform calculation (B) with constant R, output to G |
| R G B G | Memory cell (first G) copied or added to second memory cell (second G), altered by R |
| R G B G B | Perform calculation (B1 and B2 together) with constant (R) and memory cell (first G), assign to second G |
| R B G R B | Perform calculation (B1 and B2 together) with two constants (R1, R2) and memory cell (first G), assign to second G |
All sequences begin with R. The only combination where an R falls in the middle of a command is the last sequence, which is the only one beginning with R B, to set it apart.
Program Decay
Blue's commands are the ones that require the closest attention to details of the street. They are also the ones which are likely to change over time, as new construction alters aspects of Blue's code. It is expected that programs will change meaning over time. It is also expected that some programs will be misunderstood by other Blues and lead to incorrect computation. It is the job of Blue to find a minimalist way to indicate their encoding to the next Blue, using as few symbols as possible.