esolang

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

Expected: Hello, world!

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

CommandDoes
a b c dPop two and push their sum, difference, product or quotient
e fMove the front to the back; drop the front
gy ... gzLoop as long as the front is not 0
h iRead a character to the back; pop one and print it
jPop x and push x minus 1, or 1 when x is 0
tReplace 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.
Expected: cat
Expected: https://translate.google.com/?sl=en&tl=es&text=&op=translate

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!.

Expected: https://translate.google.com/?sl=en&tl=es&text=Hello%2C%20world!&op=translate

Patterns it teaches

Further

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 taglate

Source

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