Analog Synth

From Esolang
Jump to navigation Jump to search

Analog Synth is a joke language (weakscript) created for the sole purpose of enabling a multi-language interpreter to be written in another esoteric language, ΙΧΘΥΣ. A multi-language interpreter is one that can interpret the code of more than one language, and produces the expected output of either/both.

Analog Synth is a more wholesome version of the joke esolang Poop. In the style of TrivialBrainfuckSubstitutions, Analog Synth could be termed a Trivial Poop Substitution, AKA, to borrow accepted medical terminology, a Trivial Fecal Transplant.

No disrespect is intended to any Analog Synth by the unfortunate choice of parent language. The command tokens of Analog Synth are intended to stand on their own thematic strength as a perfectly valid and useful programming language.

Despite Analog Synth being a completely independent and respectable language, there is a cheeky reference to the source in its title.

Commands

Command Description
patch Move the pointer to the right
buchla Move the pointer to the left
moog Add pointed character to the string
MOOG Add pointed character to the string uppercased
sine Show the string
ems Empty the string and set pointer to 0

Background

ΙΧΘΥΣ is a low level Turing complete language which recognises single character command tokens. Analog Synth is not Turing complete, and uses a small number of multi-character tokens. The basic (simplistic!) pointer movement and output operations of each language are however very similar.

The multi-character tokens of many simplistic esoteric joke languages, like this one, Chicken, and others are very inefficient in terms of information density. Other low-level esolangs have an opposing tendency to have very terse single (most often ASCII) character tokens. The idea for this multi-interpreter was intended to be a meditation on that tension between the uselessly verbose and awkwardly terse languages: implement an interpreter for the verbose style using one limited to terse tokens. Doubling the languages supported by the interpreter with no extra code emphasises the redundancy in simplistic-but-verbose languages.

Examples

Hello World

patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch

MOOG

buchla buchla buchla

moog

patch patch patch patch patch patch patch

moog

moog

patch patch patch

moog

sine

ems

patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch patch

MOOG

buchla buchla buchla buchla buchla buchla buchla buchla

moog

patch patch patch

moog

buchla buchla buchla buchla buchla buchla

moog

buchla buchla buchla buchla buchla buchla buchla buchla

moog

ems

buchla buchla buchla buchla buchla buchla buchla buchla
buchla buchla buchla buchla buchla buchla buchla buchla
buchla buchla buchla buchla buchla buchla

MOOG

sine

Compare Poop#Hello_World. The Analog Synth version is much better, but it wasn't written, merely converted.

Interpreter

In ΙΧΘΥΣ, the punchline multi-interpreter:

ΙtιΘΙuχΘ
ΙσΙ𝞻χΙΣιΘΙϲιΘ𝞻ΘΘ
ΙςΙoσ𝞻χΣχΙϲχΥΧΘΙΣΧΘΙoςΘΘΘ
ΙoςΘ
ΙsΧιιιθθιιιιιιΘ
ΙnΙϲΧχΘΧϲιιιιιιθχχχχΥΙΣΧχΘΣsΘ
ΙOχχχχχχχχχχχχχχχχχχχχχχχχχχχχχχχχoιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιιΘ
s

This defines commands which will process the characters of Analog Synth and Poop code one by one, and output the expected alphabetic characters (in the correct case) when those source files are subsequently loaded into the ΙΧΘΥΣ interpreter. A motivating factor behind this exercise was the fact that the o/O of the moog and MOOG commands have to be triggered twice to perform the single "add character" action, which seemed like an interesting mechanic.

Possible improvements

The above interpreter does not correctly handle digits and punctuation of the Poop 1.0 specification character sequence, which annoyingly differs from the ASCII / Unicode order. Analog Synth deliberately does not specify an order at this stage. The interpreter should be updated at some point to enable correct digits and punctuation. I believe it is 'close enough' for the practical purpose of exploring information-density concept, but could be an exercise for someone else to complete.