No Literals, Gotos Only, Final Destination!

From Esolang
Jump to: navigation, search

No Literals, Gotos Only, Final Destination! is an esoteric language created by Something Fawful. It is the first one he created, starting in 2017, but only recently has he created a working interpreter. As the name of the language implies, No Literals, Gotos Only, Final Destination! does not have any predefined numeric on string literals, and every single line contains an implicit goto statement.

Usage

Each line consists of an operation, optionally followed by a comma and a list of variables, separated by commas. If the variable names are invalid (that is to say they contain one of the operators) a compliant interpreter MUST throw an error upon executing this line. Lines that are never executed can be invalid, allowing them to be used for comments. Upon executing a line, the result of the value before the , is calculated, and it is assigned to all variables after the comma. The execution will then jump to the line number of the result, modded by the total number of lines in the program. The program will halt upon executing an empty line. The bracket stack will be empty at the start of a line, and a compliant interpreter MUST throw an error if a line ends with a non-empty bracket stack.

Operator Usage
+ Adds the current value to the value after the +, much like in normal math.
- Subtracts the value after the - from the current value, much like in normal math.
* Multiplies the current value with the value after the *, much like in normal math.
\ Divides the value after the \ by the current value, so a\b would be the same as b/a in a normal language. Note that division of zero by zero returns one. Other division by zero SHOULD throw an error.
 : Output the current line number module the value after the : to the output specified by the current value. The return value from this is undefined, and should probably not be used.
 ? Input - the return value from this, is the next [value after the ?] of data from input [current value] See Input/Output section for more information.
) Pushes the current value onto the bracket stack.
( Pops the latest value onto the bracket stack, appends it to the current value. (See parsing variables)
, Delements between the equation, and variables.
. reserved for future usage.

Parsing Variables

In the execution string, variables are defined by characters other than the operators. However, variables can also be appended to one another. For example, if we have a variable a with a value of 1 than aa will have a value of 11 or 20 in decimal (as No Literals, Gotos Only, Final Destination! internally uses base 19, naturally). However if the variable aa also existed (say with a value of 5) then aa would obviously be 5. aaa would be 51 and aaaa would be 55 as it is greedy, looking for the longest variable name, starting from the left.

Getting Numbers

The way variables are parsed, along with the fact that an empty string evaluates as zero and the way division of zero by zero works allows us to set up numeric constants as shown in the program snippet below

\,1
1+1,2
2+1,3
3+1,4
4+1,5
5+1,6
6+1,7
7+1,8
8+1,9
9+1,A
A+1,B
B+1,C
C+1,D
D+1,E
E+1,F
F+1,G
G+1,H
H+1,I
I+10
,0

















[start of program here]

The first line divides nothing by nothing, thus giving us 1, which we assign to 1. Line one adds one and one, giving us 2 which we assign to 2. This process continues until the line I+10 as we haven't defined 10 it checks 1 which has a value of 1. It then checks 0 which is undefined (so empty) thus 10 equals 1. The next line assigns nothing to 0. However, since we can't actually re-assign nothing to a variable, it will give it an actual value of zero. It will then jump to line zero, and pointlessly repeat all the lines until it gets back to I+10. Now that 0 is defined, 10 behaves as expected, returning to.

Input and output

The following examples are assuming that the variables 0-I are defined as above. The standard states that output and input 0 should be stdin and stdout. The other inputs and outputs are up to the implementation, although standards may be recommended at a later date. Anyway, a standard input line will look something like this.

0?91

This would read 1 byte from the standard input. A standard output line will look something like this.

0:91

This will output a single byte to standard output. The value of that standard byte is the line number mod dec 256 (so line 257 would be 1). The standard implementation uses UTF-8 for the output.

Example Programs

I've probably done a bad job explaining this so have some example programs that might do a better job.

Hello, World!

this program prints Hello, World!

\,1
1+1,2
2+1,3
3+1,4
4+1,5
5+1,6
6+2,8

8+1,9
9+1,A
A+1,B
B+2,D

D+1,E
E+1,F
F+1,G
G+10
0,0

0,0
5D
5D
15,b
55
5G
26
60





0:D9*0+4B
0:D9*0+18

3F








0:D9*0+1D



























0:D9*0+56














0:D9*0+5G












0:D9*0+1E
0:D9*0+11,a






0:D9*0+a+1,a


0:D9*0+b+1,b


0:D9*0+5D

Truth machine

This truth machine does not use the standard for defining numeric constants that was recommended above, specifically to demonstrate the lack of literals.

\,a
a+a+a+a+a+a+a+a+a,b







b+a+a+a+a,c



?cb,d


































:cb*+a+a
:cb*+d

An almost complete 99 bottles of beer

This implementation has one issue, in that it doesn't get rid of the 0 in front of the number for the last 10 bottles of beer on the second line. This is due to me making an error, the fact that the other 2 numbers I remembered to correct it for proves it can be done. I just don't want to try and re-parse my code.

\,1
1+1,2
2+1,3
3+1,4
4+1,5
5+1,6
6+1,7
7+1,8
8+1,9
9+1,A
A+1,B
B+1,C
C+1,D
D+1,E
E+1,F
F+1,G
G+1,H
H+1,I
I+10
0,0
A*17I\bottles+G0+1AEH,r
A*17I\bottles*A)17I\bottles-(+G0+1C3G,r
E7AEA3FE5210C065,r
17I\bottles-1\0+15
1H94,r
88534FH72A010C0D9BEEA340462D76964H4007I0FG68CFD4,r
A*17I\bottles+G0+205B,r
A*17I\bottles*A)17I\bottles-(+G0+21DA,r
I0FDG72FI7105DII,r
17I\bottles-1\0+1B
26IH,r
12H5H7I44C74262H3D766235BGCICI2DG209HIIF40F70I56C6C074CG998CEG5DI4C16F037E1BA70E59B84AI70,r
17I\bottles-1*17I+1E,bottles
A*17I\bottles\0+1F
A*17I\bottles+G0+2BC3,r
17I\bottles\0+20

54*17I+11,bottles
A*17I\bottles*A)17I\bottles-(+G0+2IDH,r
HDDC288226F0449BGC30434H4572G7DCG3FDF939DD98G7HCD0509AH6A86DD2BE12F,r
1666C9DF06H0IC366,r
17I\bottles-1\0+24
3505,r
111B3H8C63H17EE6D78EH0G31752A52DHH056648B9524D5BC6C,r
A*17I\bottles\0+11



















































































































































































































0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r
0: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I\r,r
0:D9*0+17I\r,r
0:D9*0+17I\r,r

Computational Class

Unless I've screwed something up the following is a interpreter for a borked version of brainfuck, with the following changes: 1. the code is read backwards. 2. Comments are not handled, the file should only use valid characters. 3. The first character after the brainfuck code should be a valid end codepoint. In my case I've used !. 4. Input also needs to be entered in reverse. I see no reason this version of brainfuck should not be Turing complete, which would mean No Literals, Gotos Only, Final Destination! is Turing complete. Note this uses input 3 for the code. In the oficial implementation, input 1 is the number of arguments, 2, 4, 6, etc. are the arguments, and 3, 5, 7 etc. are the files located at the argument paths. Ergo usage would be something like python3 ./nlgofd.py bf.fd brainfuck-filename

\,1
1+1,2
2+1,3
3+1,4
4+1,5
5+1,6
6+1,7
7+1,8
8+1,9
9+1,A
A+1,B
B+1,C
C+1,D
D+4,H



H+1,I
I+10
,0,memory
17I\ip*D9*17I+12,ip
17I\program)17I\ip*D9\(*D9)17I\program)17I\ip\(-(+4
D9*17I\ip*17I+14,ip
17I\program)17I\ip*D9\(*D9)17I\program)17I\ip\(-(+8
17I+11,bracketDepth
1H
17I+13,bracketDepth
17I\bracketDepth\0)1-(+19
1H
11
17I\bracketDepth\0)1-(+1C
1H
13



17I\ip*D9*17I+21,ip
17I+20,ip,pointer
3?0*17I+1H,program
17I\program)17I\ip*D9\(*D9)17I\program)17I\ip\(-(



17I\pointer)17I\memory)17I\pointer*D9\(*(*D9)17I\pointer)17I\pointer)17I\memory+()17I\pointer*D9\(*(*D9)17I\pointer)17I\memory+(-(+(*17I+1H,memory
17I\pointer)0?D9*()17I\pointer)17I\memory)17I\pointer*D9\(*D9)17I\memory)17I\pointer\(-(*()17I\memory-(+(*17I+1H,memory
17I\pointer)17I\memory)17I\pointer*D9\(*(*D9)17I\pointer)17I\pointer*D8)17I\memory+()17I\pointer*D9\(*(*D9)17I\pointer*D8)17I\memory+(-(+(*17I+1H,memory
17I\pointer*1021A\memory*D9)17I\pointer*17I\memory-(+D9
11
11
11
11
13
13
13
13





17I\pointer)D9\(*17I+1H,pointer

17I\pointer*D9*17I+1H,pointer

11

11

13

13




















17I\pointer*1021A\memory*D9)17I\pointer*17I\memory-(\0)1-(+15

17I\pointer*1021A\memory*D9)17I\pointer*17I\memory-(\0)1-(+16

17I\bracketDepth*17I*17I+11,bracketDepth

17I*17I\bracketDepth*17I+18,bracketDepth

17I*17I\bracketDepth*17I+1B,bracketDepth

17I\bracketDepth*17I*17I+13,bracketDepth


























































































































































0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
0:D9*0+1H
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