RNA

From Esolang
(Redirected from DNA)
Jump to navigation Jump to search

RNA is a totally useless esoteric programming language created in 2008 and implemented in 2011 by Cyrus H..

Syntax

There are 16 instructions(49 codons) in this language.

Also, there are three special storages, which are used to handle data. They are:

  • strg - a 8-bit(1 Byte) cell that is used to manipulate memory index storage, ptr. Internally, this storage is declared as unsigned char.
  • ptr - a 32-bit(4 Bytes) memory index storage. In 64-bit platforms, this storage uses 64-bit(8 Bytes). Internally, this storage is declared as unsigned char *.
  • memory - a serial storage that contains 8-bit(1 Byte) cells. Theoretically, there is no limit to this storage. The only limit is the physical memory, RAM. Internally, this storage is declared as unsigned char [].

Following list contains all the instructions defined in this language.

  1. Methionine (Met.)
    • AUG
    • Program activation indicator. Codons prior to this will simply be ignored.
  2. [None] (Ter.)
    • UAA, UAG, UGA
    • Program termination indicator. Codons after this will simply be ignored.
  3. Tryptophan
    • UGG
    • strg=0
  4. Lysine
    • AAA, AAG
    • ++strg
  5. Asparagine
    • AAC, AAU
    • --strg
  6. Alanine
    • GCA, GCC, GCG, GCU
    • strg=*ptr
  7. Threonine
    • ACA, ACC, ACG, ACU
    • ptr=&memory[strg]
  8. Proline
    • CCA, CCC, CCG, CCU
    • scanf(“%d”, ptr)
  9. Leucine
    • CUA, CUC, CUG, CUU
    • printf(“%c”, *ptr)
  10. Arginine
    • AGA, AGG, CGA, CGC, CGG, CGU
    • *ptr+=memory[strg]
  11. Serine
    • AGC, AGU, UCA, UCC, UCG, UCU
    • *ptr*=memory[strg]
  12. Glutamine
    • CAA, CAG
    • *ptr-=memory[strg]
  13. Histidine
    • CAC, CAU
    • *ptr/=memory[strg]
  14. Glutamic acid
    • GAA, GAG
    • *ptr=*ptr==memory[strg]?1:0
  15. Aspartic acid
    • GAC, GAU
    • Loop activation indicator. This will initiate while(*ptr) immediately and proceed to next codon. If the *ptr is equal to zero(0), this will move interpreter’s execution pointer to a codon just after the paired loop termination indicator.
  16. Tyrosine
    • UAC, UAU
    • Loop termination indicator. This will move interpreter’s execution pointer back to the paired loop activation indicator.
  17. Cysteine
    • UGC, UGU
    • No-Op. Reserved for future implementation.
  18. Phenylalanine
    • UUC, UUU
    • No-Op. Reserved for future implementation.
  19. Isoleucine
    • AUA, AUC, AUU
    • No-Op. Reserved for future implementation.
  20. Glycine
    • GGA, GGC, GGG, GGU
    • No-Op. Reserved for future implementation.
  21. Valine
    • GUA, GUC, GUG, GUU
    • No-Op. Reserved for future implementation.

Implementation

Dialect

DNA

The DNA Programming language is basically a dialect of the RNA Programming Language. The instructions from RNA and DNA are one-to-one matching. Converting a program from RNA to DNA is very easy task; just Find & Replace each instructions. For more information, read DNA subdocument.