DNA-Sharp

DNA# is an esoteric programming language which is based on the schematic structure of the DNA molecule and was invented 2009 by User: Benni++.

Commands
There are 16 commands: * A line of ATAT or ATGC commands, selecting "newpointer", can follow these commands (see Special Commands)

** Adding three CGCG commands in a row will print out the program's source (line form)

*** newpointer is only active after Special Commands

**** This change is unofficial and intends to remove ambiguous use of =

Interpreter(s)
For now, there is only a single interpreter, written in Javascript. It simulates a Turing-complete 1D data matrix using a simple javascript array.

Appearance
There are three forms of DNA#:
 * 1) Helix form (see below)
 * 2) Line form (example: "ATGCATATGCATTACG", helix form without "-" and whitespace)
 * 3) Symbol form (example: "++>=+= Commented: + + +        /* add 3 to reg0 */ >            /* select reg1   */ += <         /* add reg(1-1) (= reg0 ) to reg1 (reg1 is set to 3) */ X            /* nop to stop interpreter from going to non-existant reg(-1) */ >            /* continue in code... */

C-Equivalent to upper example: // pos = 0 reg[pos]++; reg[pos]++; reg[pos]++; pos++; reg[pos] += reg[pos-1]; // actually newpos = pos; newpos--; reg[pos] += reg[newpos] pos++;

The compiler/interpreter first sets newpos to pos, then parses through the following code until he finds an command inequal ATAT or ATGC. Doing this, he increments (decrements for ATGC) newpos. In the end the actually selected operation (in this case +=) is done.

Hello World Program
Hello, World! Program in DNA# (Helix form): HelloWorld.dna AT   T--A AT  T-A T-A GC   T--A GC    CG    C--G AT  A-T T-A AT   A--T GC    AT    C--G TA  C-G T-A GC   C--G CG    AT    A--T TA  A-T A-T GC   A--T GC    TA    G--C TA  G-C C-G CG   A--T GC    TA    G--C AT  G-C A-T CG   A--T CG    GC    A--T AT  C-G A-T CG   A--T CG    GC    A--T TA  G-C A-T GC   A--T CG    GC    A--T GC  A-T A-T TA   A--T TA    AT    T--A GC  A-T A-T AT   G--C AT    AT    G--C TA  G-C A-T GC   G--C AT    TA    T--A AT  G-C G-C AT   A--T TA    AT    T--A AT  T-A G-C AT   T--A TA    AT    G--C AT  T-A A-T TA   G--C AT    TA    T--A AT  G-C G-C AT   A--T AT    AT    T--A GC  A-T

Hello, world! program (line form):

ATTAATTATAGCTAGCCGCGATATTAATATGCATCGTACGTAGCCGCGATATTAATATGCATGCTAGCTAGCCGCGATGCTAGCATGCATCGATCGGCATATCGATCGATCGGCATTAGCATG CATCGGCATGCATATTAATTAATTAGCATATATGCATATGCTAGCATGCGCATTATAATGCGCATATTAATTAATTAGCATTATAATGCATTAATTAGCATTATAATGCGCATATATATTAGCAT

Hello, world! program (symbol form): +++=+=X>=<-*=+=X>=<<+=+=X<+=<--.---.+=<-..+++.>.<+=<.-=<.+++.-=<++.-=<.>+.

Fibonacci Numbers:
ATTAATTAATTAATTAATTATACGCGCGATATATATATTAATATATATTAATATGCATGCATGCATGCATTAATTAATTAATTAATTAATTAATTAATGCATGCATGCATGCGCTAATATATATATATTAATATGCTAGCATG CATGCCGCGATGCATGCTAATATATCGCGATATTAATATATCGCGATATCGGCATATGCATATGCATGCATGCATGCATCGGCCG

AT   T--A AT  T-A A-T TA   A--T TA    AT    T--A TA  C-G C-G CG   A--T AT    AT    A--T AT  T-A A-T AT   A--T AT    TA    A--T AT  G-C A-T GC   A--T GC    AT    G--C AT  T-A A-T TA   A--T TA    AT    T--A AT  T-A A-T TA   A--T TA    AT    G--C AT  G-C A-T GC   A--T GC    GC    T--A AT  A-T A-T AT   A--T AT    TA    A--T AT  G-C T-A GC   A--T GC    AT    G--C CG  C-G A-T GC   A--T GC    TA    A--T AT  A-T C-G CG   A--T AT    TA    A--T AT  A-T C-G CG   A--T AT    CG    G--C AT  A-T G-C AT   A--T GC    AT    G--C AT  G-C A-T GC   A--T CG    GC    C--G

+++++*=X>>+>>=<<<<+++++++<<<<[>>>=<+==>X>~>.<<<<-]

Quine
CGCGCGCGCGCG

External resources
DNA# online interpreter