esolang

AGG

A program is a strand of DNA. Each codon means what the one-letter code of its amino acid spells.

mmph, 2023 · Turing complete: yes · ●●○ moderate · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: Hello, World!

The idea

mmph made AGG in 2023, pronounced "AAUUGHH!!!!". A program is a list of codons, three letters each from A, C, T and G. What the codon does in a cell means nothing; only the abbreviation counts. ATG codes for methionine, M, so it multiplies. TGT and TGC code for cysteine, C, so they print. The three stop codons close a loop.

Read the story

A push takes the next codon as a number in base 4, with A, C, T and G as 0, 1, 2 and 3. So TCG is 213, which is 39.

The machine

LetterCodonsDoes
CTGT TGCPop and print as a character
IATT ATC ATAPush the codes of a line of input
PCCT CCC CCA CCGPush the next codon as a number
A S M D HGCT TCT ATG GAT CAT and moreAdd, subtract, multiply, divide, modulo
VGTT GTC GTA GTGDuplicate the top
TACT ACC ACA ACGReverse the stack
F RTTT TTC, and CGT AGA and moreMove the top to a memory stack, and back
LCTT TTA and moreSkip past the matching stop when the top is 0
StopTAA TAG TGAGo back to the matching L when the top is not 0

The seven amino acids that are no command, such as lysine in AAA, do nothing. A word that is not a codon is ignored, and right after a push it counts as 0. Arithmetic takes the top and the one below it and leaves the one below minus, divided by or modulo the top.

Example

The Hello World builds every letter from small numbers.

The Hello World builds every letter from small numbers. CCT TCA pushes 36, CCC AAT pushes 2, ATG multiplies them into 72 and TGT prints H.

The cat reads a line, puts a 0 under it by pushing and reversing, and prints until it reaches the 0.

Expected: cat

The truth machine takes 48 from the digit it reads. On 0 the loop is skipped, and adding 48 again makes the 0 it prints. On 1 the loop prints 1 forever.

Expected: 0

Patterns it teaches

Further

Stack-based

Write your own in Run Convert a program from AGG

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: agg.

Command line

shib run agg -e 'ATA CCT AAA ACC CTT TGT TAA' --input 'cat'
shib manual agg

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/agg.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org