FME
FME (short for Finite Memory Esolang) is an esolang that is made to implement esolangs with finite memory in simple but long code.
Memory
FME programs use a finite amount of memory: A fixed array with byte cells, initially all zero.
Format
The format of an FME program is like this:
<command or program block>: <memory before> -> <memory after> <additional> (or @<program block>) <memory before> -> <memory after> <additional> (or @<program block>) <memory before> -> <memory after> <additional> (or @<program block>) ... <command or program block>: <memory before> -> <memory after> <additional> (or @<program block>) <memory before> -> <memory after> <additional> (or @<program block>) <memory before> -> <memory after> <additional> (or @<program block>) ... ...
Command
The command is a one character command, case sensitive.
If the command has more than one characters, it is a program block and can only be called by a command or another program block.
Program blocks are called using @
, if @
is used without the name of a program block, the program will halt.
Memory before
It is the memory before the operation, in hex dump (uppercase).
Memory after
It is the memory after the operation, in hex dump (uppercase), the length of memory after must be the same as the length of memory before.
To sum up, lines like this check if the memory is the same as memory before, if it is, change it to memory after.
For example:
A: 00 -> 01
Defines a command A that makes the only byte in the memory 1 if it is 0.
B: 00 01 -> 01 01 01 00 -> 01 01
Defines a command B that makes the memory 01 01
if it is 00 01
or 01 01
.
Additional
Additional makes the program do I/O, it is optional.
<= <index>
Reads a byte, and makes the <index>-th (0-indexed) cell become the same as the byte.
=> <index>
Prints the index-th byte (0-indexed).
The input and output are done before changing the memory.
Interpretation
When executed, it gets some code and interprets it using the commands in the program.
Examples
PlusOrMinus interpreter
+: 00 -> 01 01 -> 02 02 -> 03 03 -> 04 04 -> 05 05 -> 06 06 -> 07 07 -> 08 08 -> 09 09 -> 0A 0A -> 0B 0B -> 0C 0C -> 0D 0D -> 0E 0E -> 0F 0F -> 10 10 -> 11 11 -> 12 12 -> 13 13 -> 14 14 -> 15 15 -> 16 16 -> 17 17 -> 18 18 -> 19 19 -> 1A 1A -> 1B 1B -> 1C 1C -> 1D 1D -> 1E 1E -> 1F 1F -> 20 20 -> 21 21 -> 22 22 -> 23 23 -> 24 24 -> 25 25 -> 26 26 -> 27 27 -> 28 28 -> 29 29 -> 2A 2A -> 2B 2B -> 2C 2C -> 2D 2D -> 2E 2E -> 2F 2F -> 30 30 -> 31 31 -> 32 32 -> 33 33 -> 34 34 -> 35 35 -> 36 36 -> 37 37 -> 38 38 -> 39 39 -> 3A 3A -> 3B 3B -> 3C 3C -> 3D 3D -> 3E 3E -> 3F 3F -> 40 40 -> 41 41 -> 42 42 -> 43 43 -> 44 44 -> 45 45 -> 46 46 -> 47 47 -> 48 48 -> 49 49 -> 4A 4A -> 4B 4B -> 4C 4C -> 4D 4D -> 4E 4E -> 4F 4F -> 50 50 -> 51 51 -> 52 52 -> 53 53 -> 54 54 -> 55 55 -> 56 56 -> 57 57 -> 58 58 -> 59 59 -> 5A 5A -> 5B 5B -> 5C 5C -> 5D 5D -> 5E 5E -> 5F 5F -> 60 60 -> 61 61 -> 62 62 -> 63 63 -> 64 64 -> 65 65 -> 66 66 -> 67 67 -> 68 68 -> 69 69 -> 6A 6A -> 6B 6B -> 6C 6C -> 6D 6D -> 6E 6E -> 6F 6F -> 70 70 -> 71 71 -> 72 72 -> 73 73 -> 74 74 -> 75 75 -> 76 76 -> 77 77 -> 78 78 -> 79 79 -> 7A 7A -> 7B 7B -> 7C 7C -> 7D 7D -> 7E 7E -> 7F 7F -> 80 80 -> 81 81 -> 82 82 -> 83 83 -> 84 84 -> 85 85 -> 86 86 -> 87 87 -> 88 88 -> 89 89 -> 8A 8A -> 8B 8B -> 8C 8C -> 8D 8D -> 8E 8E -> 8F 8F -> 90 90 -> 91 91 -> 92 92 -> 93 93 -> 94 94 -> 95 95 -> 96 96 -> 97 97 -> 98 98 -> 99 99 -> 9A 9A -> 9B 9B -> 9C 9C -> 9D 9D -> 9E 9E -> 9F 9F -> A0 A0 -> A1 A1 -> A2 A2 -> A3 A3 -> A4 A4 -> A5 A5 -> A6 A6 -> A7 A7 -> A8 A8 -> A9 A9 -> AA AA -> AB AB -> AC AC -> AD AD -> AE AE -> AF AF -> B0 B0 -> B1 B1 -> B2 B2 -> B3 B3 -> B4 B4 -> B5 B5 -> B6 B6 -> B7 B7 -> B8 B8 -> B9 B9 -> BA BA -> BB BB -> BC BC -> BD BD -> BE BE -> BF BF -> C0 C0 -> C1 C1 -> C2 C2 -> C3 C3 -> C4 C4 -> C5 C5 -> C6 C6 -> C7 C7 -> C8 C8 -> C9 C9 -> CA CA -> CB CB -> CC CC -> CD CD -> CE CE -> CF CF -> D0 D0 -> D1 D1 -> D2 D2 -> D3 D3 -> D4 D4 -> D5 D5 -> D6 D6 -> D7 D7 -> D8 D8 -> D9 D9 -> DA DA -> DB DB -> DC DC -> DD DD -> DE DE -> DF DF -> E0 E0 -> E1 E1 -> E2 E2 -> E3 E3 -> E4 E4 -> E5 E5 -> E6 E6 -> E7 E7 -> E8 E8 -> E9 E9 -> EA EA -> EB EB -> EC EC -> ED ED -> EE EE -> EF EF -> F0 F0 -> F1 F1 -> F2 F2 -> F3 F3 -> F4 F4 -> F5 F5 -> F6 F6 -> F7 F7 -> F8 F8 -> F9 F9 -> FA FA -> FB FB -> FC FC -> FD FD -> FE FE -> FF FF -> 00 -: 00 -> FF => 0 01 -> 00 => 0 02 -> 01 => 0 03 -> 02 => 0 04 -> 03 => 0 05 -> 04 => 0 06 -> 05 => 0 07 -> 06 => 0 08 -> 07 => 0 09 -> 08 => 0 0A -> 09 => 0 0B -> 0A => 0 0C -> 0B => 0 0D -> 0C => 0 0E -> 0D => 0 0F -> 0E => 0 10 -> 0F => 0 11 -> 10 => 0 12 -> 11 => 0 13 -> 12 => 0 14 -> 13 => 0 15 -> 14 => 0 16 -> 15 => 0 17 -> 16 => 0 18 -> 17 => 0 19 -> 18 => 0 1A -> 19 => 0 1B -> 1A => 0 1C -> 1B => 0 1D -> 1C => 0 1E -> 1D => 0 1F -> 1E => 0 20 -> 1F => 0 21 -> 20 => 0 22 -> 21 => 0 23 -> 22 => 0 24 -> 23 => 0 25 -> 24 => 0 26 -> 25 => 0 27 -> 26 => 0 28 -> 27 => 0 29 -> 28 => 0 2A -> 29 => 0 2B -> 2A => 0 2C -> 2B => 0 2D -> 2C => 0 2E -> 2D => 0 2F -> 2E => 0 30 -> 2F => 0 31 -> 30 => 0 32 -> 31 => 0 33 -> 32 => 0 34 -> 33 => 0 35 -> 34 => 0 36 -> 35 => 0 37 -> 36 => 0 38 -> 37 => 0 39 -> 38 => 0 3A -> 39 => 0 3B -> 3A => 0 3C -> 3B => 0 3D -> 3C => 0 3E -> 3D => 0 3F -> 3E => 0 40 -> 3F => 0 41 -> 40 => 0 42 -> 41 => 0 43 -> 42 => 0 44 -> 43 => 0 45 -> 44 => 0 46 -> 45 => 0 47 -> 46 => 0 48 -> 47 => 0 49 -> 48 => 0 4A -> 49 => 0 4B -> 4A => 0 4C -> 4B => 0 4D -> 4C => 0 4E -> 4D => 0 4F -> 4E => 0 50 -> 4F => 0 51 -> 50 => 0 52 -> 51 => 0 53 -> 52 => 0 54 -> 53 => 0 55 -> 54 => 0 56 -> 55 => 0 57 -> 56 => 0 58 -> 57 => 0 59 -> 58 => 0 5A -> 59 => 0 5B -> 5A => 0 5C -> 5B => 0 5D -> 5C => 0 5E -> 5D => 0 5F -> 5E => 0 60 -> 5F => 0 61 -> 60 => 0 62 -> 61 => 0 63 -> 62 => 0 64 -> 63 => 0 65 -> 64 => 0 66 -> 65 => 0 67 -> 66 => 0 68 -> 67 => 0 69 -> 68 => 0 6A -> 69 => 0 6B -> 6A => 0 6C -> 6B => 0 6D -> 6C => 0 6E -> 6D => 0 6F -> 6E => 0 70 -> 6F => 0 71 -> 70 => 0 72 -> 71 => 0 73 -> 72 => 0 74 -> 73 => 0 75 -> 74 => 0 76 -> 75 => 0 77 -> 76 => 0 78 -> 77 => 0 79 -> 78 => 0 7A -> 79 => 0 7B -> 7A => 0 7C -> 7B => 0 7D -> 7C => 0 7E -> 7D => 0 7F -> 7E => 0 80 -> 7F => 0 81 -> 80 => 0 82 -> 81 => 0 83 -> 82 => 0 84 -> 83 => 0 85 -> 84 => 0 86 -> 85 => 0 87 -> 86 => 0 88 -> 87 => 0 89 -> 88 => 0 8A -> 89 => 0 8B -> 8A => 0 8C -> 8B => 0 8D -> 8C => 0 8E -> 8D => 0 8F -> 8E => 0 90 -> 8F => 0 91 -> 90 => 0 92 -> 91 => 0 93 -> 92 => 0 94 -> 93 => 0 95 -> 94 => 0 96 -> 95 => 0 97 -> 96 => 0 98 -> 97 => 0 99 -> 98 => 0 9A -> 99 => 0 9B -> 9A => 0 9C -> 9B => 0 9D -> 9C => 0 9E -> 9D => 0 9F -> 9E => 0 A0 -> 9F => 0 A1 -> A0 => 0 A2 -> A1 => 0 A3 -> A2 => 0 A4 -> A3 => 0 A5 -> A4 => 0 A6 -> A5 => 0 A7 -> A6 => 0 A8 -> A7 => 0 A9 -> A8 => 0 AA -> A9 => 0 AB -> AA => 0 AC -> AB => 0 AD -> AC => 0 AE -> AD => 0 AF -> AE => 0 B0 -> AF => 0 B1 -> B0 => 0 B2 -> B1 => 0 B3 -> B2 => 0 B4 -> B3 => 0 B5 -> B4 => 0 B6 -> B5 => 0 B7 -> B6 => 0 B8 -> B7 => 0 B9 -> B8 => 0 BA -> B9 => 0 BB -> BA => 0 BC -> BB => 0 BD -> BC => 0 BE -> BD => 0 BF -> BE => 0 C0 -> BF => 0 C1 -> C0 => 0 C2 -> C1 => 0 C3 -> C2 => 0 C4 -> C3 => 0 C5 -> C4 => 0 C6 -> C5 => 0 C7 -> C6 => 0 C8 -> C7 => 0 C9 -> C8 => 0 CA -> C9 => 0 CB -> CA => 0 CC -> CB => 0 CD -> CC => 0 CE -> CD => 0 CF -> CE => 0 D0 -> CF => 0 D1 -> D0 => 0 D2 -> D1 => 0 D3 -> D2 => 0 D4 -> D3 => 0 D5 -> D4 => 0 D6 -> D5 => 0 D7 -> D6 => 0 D8 -> D7 => 0 D9 -> D8 => 0 DA -> D9 => 0 DB -> DA => 0 DC -> DB => 0 DD -> DC => 0 DE -> DD => 0 DF -> DE => 0 E0 -> DF => 0 E1 -> E0 => 0 E2 -> E1 => 0 E3 -> E2 => 0 E4 -> E3 => 0 E5 -> E4 => 0 E6 -> E5 => 0 E7 -> E6 => 0 E8 -> E7 => 0 E9 -> E8 => 0 EA -> E9 => 0 EB -> EA => 0 EC -> EB => 0 ED -> EC => 0 EE -> ED => 0 EF -> EE => 0 F0 -> EF => 0 F1 -> F0 => 0 F2 -> F1 => 0 F3 -> F2 => 0 F4 -> F3 => 0 F5 -> F4 => 0 F6 -> F5 => 0 F7 -> F6 => 0 F8 -> F7 => 0 F9 -> F8 => 0 FA -> F9 => 0 FB -> FA => 0 FC -> FB => 0 FD -> FC => 0 FE -> FD => 0 FF -> FE => 0
Hello++ interpreter
print72: 48 -> 65 => 0 @print101 print101: 65 -> 6C => 0 @print108 print108: 6C -> 6C => 0 @print108 print108: 6C -> 6F => 0 @print111 print111: 6F -> 2C => 0 @print44 print44: 2C -> 20 => 0 @print32 print32: 20 -> 57 => 0 @print87 print87: 57 -> 6F => 0 @print111 print111: 6F -> 72 => 0 @print114 print114: 72 -> 6C => 0 @print108 print108: 6C -> 64 => 0 @print100 print100: 64 -> 21 => 0 @print33 print33: 21 -> 21 => 0 h: @print72 H: @print72
1 Bit, a quarter byte interpreter
run: 00 -> 00 01 -> 01 10 -> 01 11 -> 10 a: @run b: 00 -> 01 @run c: 00 -> 10 @run d: 00 -> 11 @run
Note, code (and result) is stored in the fourth and last bit of the memory, use the commands a
to d
to execute the esolang with the memory 01
to 11
.
Interpreters
None yet.