We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

User:Aadenboy/yRNA

From Esolang
Jump to navigation Jump to search

Draft dated likely to 2022.

--[[
    NOTE: [codon] indicates any codon apart from STP, the codon will not be interpreted as it's own instruction

    Met - starts chain
    STP - stops chain and prints the Met protein stack, then clearing all the protein stacks
    (start) Met STP - terminates program

    Gly - no-op

    Phe (a) (b) - arithmetic addition, puts (a) + (b) onto the protein stack
    Phe Thr (a) (b) - arithmetic subtraction, puts (a) - (b) onto the protein stack
    Thr Phe (a) (b) - arithmetic multiplication, puts (a) * (b) onto the protein stack
    Thr Phe Thr (a) (b) - arithmetic division, puts (a) / (b) onto the protein stack

    Leu (a) (b) Leu - conditional (a) = (b)
        if true, run as normal, then skip the next Ser instruction (stays true along mRNA)
        otherwise skip all instructions until the next Ser instruction (stays true along mRNA)
    Leu Thr (a) (b) Leu - conditional (a) ≠ (b)
    Leu (a) Thr (b) Leu - conditional (a) > (b)
    Leu Thr (a) Thr (b) Leu - conditional (a) < (b)

    Ile ... Ile - integer creation, use Met to separate digits, digit higher than 9 is invalid
    Ile Thr ... Ile - negative integer creation
        Ile Met Ile - 0
        Ile Met Pro Ile - 1
        Ile Met Arg Ile - 3
        Ile Met Ala Ile - 5
        Ile Met Pro Pro Ile - 2
        Ile Met Arg Pro Ile - 4
        Ile Met Ala Pro Ile - 6
        Ile Met Ala Arg Ile - 8
        Ile Met Ala Pro Pro Ile - 7
        Ile Met Ala Arg Pro Ile - 9
        Ile Met Pro Met Ile - 10

    Val [codon] (a) - pushes (a) onto protein stack [codon]
    Val [codon] Thr - reads from protein stack [codon]
    Thr Val [codon] - pops from protein stack [codon], losing the value
    Thr Val [codon] Thr - pops all values from stack [codon], losing all the values

    His (a) - goes forward (or back) (a) chains, preserving the protein stacks
    Lys (a) (b) - goes forward (put back) (a) chains, preserving the protein stacks, and returning back after (b) instructions (-1 to go all the way)
    Thr Lys (a) (b) - like Lys but without preserving the protein stacks (temporary), new data is pushed onto existing stacks

    (start) Met Gln [codon] - turns the mRNA into a function with name [codon], causing it to be skipped (for now)
    His Gln [codon] - goes to function [codon], STP will now return to where it was called, preserving the protein stacks

    Asp ... Asp - opens the file or directs to folder based on ASCII name within ..., made of Ile integers
    Asp Met Asp - opens stdio
    Thr Asp ... Asp - executes a .dna file
    Thr Asp Thr ... Asp [codon] - pushes a .ile file to stack [codon]
    Thr Thr Asp ... Asp (a) STP - writes (a) to a .ile file

    Glu (a) - starts printing amino acids after (a) instructions until another Glu is met, use Gly as an escape code (Gly Gly for literal Gly)
    Thr Glu (a) - starts printing codons after (a) instructions until another Thr Glu is met, use Gly as an escape code (Gly Gly for literal Gly) (must be escaped as Gly Thr Gly Glu)

    Tyr (a) [codon] (b) - pushes (b) onto protein stack [codon] (a) mRNAs from now
    Thr Tyr (a) [codon] (b) - pushes (b) onto protein stack [codon] (a) instructions from now

    Cys [codon] - go to next occurrence of [codon]

    Trp [codon] [codo2] - run function [codon] if [codo2] fails
    Thr Trp (a) - use (a) as a placeholder value if none is given
    Thr Trp Gln [codon] - run function [codon] if a placeholder value is required

    Asn [codon] [codo2] - run [codo2] when [codon] is ran
]]