Emo
Emo is simply a programming language that is written in all emoticons. While not an original idea, it is quite different from other attempts at this. Emo currently stands for Emoticon Memory Obfuscation and it was inspired by Brainfuck. Even though Emo is an acronym, it is written in title case and not all upper case to highlight the emotional nature of the language.
Language Overview
Like Brainfuck, Emo operates on an array of memory cells, each initially set to zero. There is a pointer, initially pointing to the first memory cell. Unlike Brainfuck, however, there are two registers. The first is a storage register, the second is more of a working area that is kind of an in between of the storage register and memory. This working area register isn't persistent between read commands, so if the value is to be saved it must be written somewhere.
Commands:
Command | Description |
---|---|
^ | Context sensitive increment operator |
- | Context sensitive decrement operator |
o | shift left |
c | shift right |
; | Read from the current memory cell into the working register |
( | Write the working register into the current memory cell |
: | Read from the register into the working register |
) | Write the working register to the register |
} | Copy the current memory location to the register |
{ | Copy the current register to the memory location |
= | Read keyboard input |
@ | Write to the console from the working register |
< | Begin a loop, must occur at the beginning of a line |
> | End a loop, must occur at the end of a line |
| | No op |
~ | Comment |
The context sensitive increment and decrement means that if the increment operator follows the ';' it will increment the pointer location, whereas if the increment operator follows ':' it will increment the working area value (that was previously read from the register).
Each operation, so to speak, results in an emoticon, and it's considered bad form to stack 'noses' even though it's syntactically correct. So, if you wanted to shift left twice and store in the register you wouldn't do ':oo)', but would instead ':o) :o)'
The looping operator loops between the start of the line containing the <
and the >
, using a REPEAT
... UNTIL memory[current] = 0
style construct.
Language History
Emo was invented in 2010 by Dustin Luck and Sean Fife.
Implementation
To date, there are two known implementations of this language. One is an emulator written in C#, the other is a .NET compiler. Both are available on the language's homepage.
Examples
Hello, World!
This program prints out the words Hello World!:
:^) :o) :o) :o) :^) :^( ~Store 10 into the zero memory postiion <;^} ~begin loop, increment pointer and copy new mem value to the register :^) :^) :^) :^) :^) :^) :^( ~Add 7 to the current register and store in memory ;^} ~increment ptr and copy new mem value to the register :^) :^) :^) :^) :^) :^) :^) :^) :^) :^( ~Add 10 to the current register and store in memory ;^} ~increment ptr and copy new mem value to the register :^) :^) :^( ~add 3 to the current register and store in memory ;^} ~increment ptr and copy new mem value to the register :^( ~add 1 to the current register and store in memory ;-| ;-| ;-| ;-} ~more the ptr down 4 and copy memory to register :-(> ~decrement current register and store in memory then loop back ;^} ~increment ptr and copy new mem value to the register :^) :^) :( :@ ~Increment the register by 2, sore in memory, and print 'H' ;^} ~increment ptr and copy new mem value to the register :^) :@ ~increment register by 1 and print 'e' :^) :^) :^) :^) :^) :^) :^) :@ ~increment register by 7 and print 'l' :@ ~print 'l' :^) :^) :^) :@ ~increment register by 3 and print 'o' :( ~store register into memory ;^} ~increment ptr and copy new mem value to the register :^) :^) :@ ~increment register by 2 and print 'W' :( ~store register into memory ;-| ;-} ~Decrement ptr twice and copy memory to register :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :@ ~increment register by 15 and print 'o' :( ~store register into memory ;^} ~increment ptr and copy new mem value to the register :@ ~print 'o' :^) :^) :^) :@ ~increment register by 3 and print 'r' :-) :-) :-) :-) :-) :-) :@ ~decrement register by 6 and print 'l' :-) :-) :-) :-) :-) :-) :-) :-) :@ ~decrement register by 8 and print 'd' ;^} ~increment ptr and copy new mem value to the register :^) :@ ~increment register and print '!' ;^| ;@ ~decrement ptr, and print '\n'
Computational class
Emo is roughly equivalent to Brainfuck in many ways, which vaguely suggests through something a bit like reduction that Emo must be fairly Turing-complete.