User:Language

From Esolang
Jump to: navigation, search

User:Language is an esoteric programming language by User:HereToAnnoy (and, technically, User:Language) that is soley dependent on this wiki.
Readers are allowed to make changes to this article and language, but if they break anything (e.g. programs), it is their job to fix it.

Programs

Programs in User:Language are a series of lines, each containing any number of integers separated by whitespace.
Programs should be distributed with a creation date (so one would know if a program is now outdated).
Each line in a program is executed one after another. Once the last line is reached, control is passed back to the first line.

Whitespace and comments

Tabs may be replaced with space, but newlines may not. Any number of repeated spaces may be replaced with one space.
Whenever // is reached, the rest of the line is ignored.

File extension

The standard file extension for User:Language is .UsrL.

Instruction pointer

The instruction pointer is a link to any page on the esolangs wiki. It is initialized to be User:Language.

Data types

User:Language contains a variety of data types, such as string, integers, stacks, and registers. Attempting to perform an numeric operation on a string or a string operation on a number will do nothing.

Commands and instructions

Commands in programs

The following is the only command that may be present in a User:Language program's source code:

X    

This command sets the IP to the Xth link in the article's body (starting at 1).

This does not count any links on the right, top, or left of the page, links marked as external (User:Language counts as external), links in the Table of Contents or links to sections, Category links that are at the bottom of an article (but ones in the middle are counted), etc. Template: and Special: links are allowed, not that they'd be of much use.

If X is 0, the IP is set to the current article's talk/discussion page, or the current talk/discusion page's article page.

If X goes to a non-existing link, nothing happens.

Note: Each occurrence of User:Language on this wiki is actually a link to this page, but it is not clickable. Occurrences of a link to the current page will still count as the Xth link. However, not all occurences of a page's title are links. In order to correctly determine whether something on an article is a link, make sure to view the source code of the article.

IP commands and instructions

Only being able to click on links doesn't do much. So, when the IP is set to certain links, certain effects happen.

Link Command
Stack Initializes the stack (and other stack) to an empty stack. This must be done before using any stack commands.
Any page with just a number in its name (decimal, reals allowed) Pushes that number to the stack.
Stack Up Moves the bottom element of the stack to the top of the stack. Pushes a zero first if the stack is empty.
Call stack/Manipulation Pops X, jumps to line X (starting from 1). Pushes a zero first if the stack is empty.
Brainfuck Sets the top of the stack to a random integer from 0 to 255. Pushes a zero first if the stack is empty.
Text Pushes an empty string to the stack.
Amnesia Pops and discards.
Minsky machine Initializes the A, B, C, and D Registers to 0. This must be done before any operations on registers.
HQ9+ Prints "Hello, World!", the program's source code, the lyrics to 99 Bottles of Beer, and increments the A Register.
Compute/IO Toggles "output silent mode" (starts as false). When true, outputting things is a NOP.
Deadfish Squares the A Register.
Deadfish~ Increments the B Register by 10.
Language list or Joke language list Exits with the error message "ANTI-CHEAT ERROR: Cheating detected!"
A blank page (i.e. EMPTYPAGE) Halts the program.
Nop No operation.
Meander After the current line is done executing, the next line is skipped. Execution continues at the line after that line.
Addleq Pops X, pops Y, then pushes X+Y. Pushes two zeroes first if the stack is empty.
Subleq Pops X, pops Y, then pushes X-Y. Pushes two zeroes first if the stack is empty.
RSSB Pops X, pops Y, then pushes X/Y. Pushes two ones first if the stack is empty.
Swap Swaps the top two values of the stack. Pushes two zeroes first if the stack is empty.
ABCD Shifts the A-D Registers (TEMP=D, D=C, C=B, B=A, A=TEMP).
Grocery List Swaps the top of the stack and the A Register. Pushes a zero first if the stack is empty.
Pig Pops X and prints it.
Linear bounded automaton Gets an number from input and pushes it.
TrivialBrainfuckSubstitution Duplicates the top value of the stack.
String Pops X, then Y.
If Y is a string, X is converted to a string (UTF-8) and appended to Y. Pushes the result.
If Y is not a string, pushes Y, then X.
StackStacks Swaps the stack with the other stack.

If a reader has commands they would like to add, they may do so.

Example programs

Readers may add programs, as long as they sign them with a working time-stamp.

Popular problems

//HereToAnnoy (talk) 04:07, 11 July 2018 (UTC)
17    //Minsky machine
5     //Esoteric programming language
20    //Malbolge
11    //Truth-machine
54    //GetWhen
2     //User:HereToAnnoy
9     //User:Language
18    //HQ9+
19    //User:GrandKeyboard (halts)

Uncommented:

17 5 20 11 54 2 9 18 19

Pushes four to the stack

The following program uses its own appearance on this article to shorten its length.

//HereToAnnoy (talk) 04:07, 11 July 2018 (UTC)
11    //Stack
1     //Esoteric programming language
20    //Malbolge
11    //Truth-machine
54    //GetWhen
2     //User:HereToAnnoy
9     //User:Language
45    //4 <---- This link is the 45th link on this page
0     //Talk:4 (halts)

Uncommented:

11 1 20 11 54 2 9 45 0

Programming strategies

  • To write programs more easily (but to make them longer), it is a good idea to return to User:Language after every command, since this page contains links to most of the commands.
  • It is a good idea to create a commented (what pages are being visited written in the comments, so the program can be repaired once changes to the wiki are made) version of a program (if possible) with a time-stamp and an uncommented version whenever one makes a program.
  • If you are distributing a program on this wiki, and the page you are distributing it to is visited in the program (or could be visited in the program), you can use its own presence on the page to connect it to any other page (using comments). See the "Pushes four to the stack" example above.

Computational class

Since User:Language's computational power (which appears to be greater than any other user's computational power) is dependent on this wiki, and it can be turing complete and turing incomplete when changes are made, we believe that makes it turing incomplete.