Taglate
A queue that can only grow by turning itself into a Google Translate link.
BoundedBeans · Turing complete: unknown · ●●● hard · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
BoundedBeans made Taglate after the tag system, and its name joins "tag" and "translate". The program starts with a queue of numbers, written as text on the first line. Commands take numbers from the front and put results at the back, so most of them make the queue shorter.
Read the story
The one command that makes it longer is t. It reads the queue as text, escapes it as a URL would, and replaces the queue with the link that opens that text in Google Translate, from English to Spanish. The specification notes the site's 5,000 character limit and decides to ignore it.
The machine
| Command | Does |
|---|---|
a b c d | Pop two and push their sum, difference, product or quotient |
e f | Move the front to the back; drop the front |
gy ... gz | Loop as long as the front is not 0 |
h i | Read a character to the back; pop one and print it |
j | Pop x and push x minus 1, or 1 when x is 0 |
t | Replace the queue with its Google Translate URL |
Numbers wrap at 65,536. j is there so that a program can make a 1, and a program gets a 0 by subtracting the two ts of https. A command that needs more numbers than the queue holds ends the program, which is how the cat and the URL program stop.
Example
The cat starts on an empty queue.
The cat starts on an empty queue. Each turn of its loop reads a character and prints it, and at the end of the input i finds the queue empty. The last program turns its empty first line into a link, then prints it one character at a time. With text on the first line, t escapes it as encodeURIComponent does, so Hello, world! goes in as Hello%2C%20world!.
Patterns it teaches
- Tag systems: read from the front, write to the back.
- Hostile design: growth only through a web address.
Further
See also
Queue-based
Write your own in Run Convert a program from Taglate
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: taglate.
Command line
shib run taglate -e '
gyhigz' --input 'cat'shib manual taglateSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/taglate.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org