Muppp

From Esolang
Jump to navigation Jump to search

Muppp is a stack based esolang made by Hex96, the commands and arguments of which are represented by arbitrary words whose length determines the identity.

The syntax

The significant constituents of a Muppp program are defined by arbitrary words without semantic value and separated by whitespaces. The tally of characters in a word determines its agency, that is, the signified command or, if an instruction depends upon further data, the parameter value.

The syntax thus receives a string like this:

Hell hello hi there

The compiler would get the lengths of each word:

4 5 2 5

That is the code.

The following Extended Backus-Naur Form (EBNF) description applies to the Muppp syntax:

 program       := [ whitespaces ] ,
                  command ,
                  { whitespaces , command } ,
                  [ whitespaces ] ;
 command       := nonWhitespace , { nonWhitespace }  ;
 nonWhitespace := asciiCharacter - whitespace ;
 whitespaces   := whitespace , { whitespace } ;
 whitespace    := " " | "\n" | "\t" ;

Tokens

Token Command
3 Pops the top off the stack
4 Pushes the next value on to the stack. The next value does not run as code.
5 Gets input and pushes the ASCII code onto the stack.
6 Looks at the top two values on the stack, if they are the same, push a 1. Else, push a 0.
7 If the top value on the stack is greater than 0, go back x amount of spaces. x being the next value. The next value is not interpreted.
8 Adds the top value on the stack by the next value, next value not interpreted.
9 Same thing as 8 but instead of adding it is subtracting.
10 Same thing, but multiplying.
11 Same thing, but dividing.
12 Same thing, but modulo.
13 Same thing as 7, but going forward.
14 Prints the ASCII character of the top value on the stack.
15 Duplicates the top value on the stack.
16 Ends the program.

Example programs

1 character cat

Hello multiplication

Infinitely repeating cat program

Input asciiCharacter restart now

Truth-machine

55555
999999999 ------------------------------------------------
4444 1
666666
88888888 ++++++++++++++++++++++++++++++++++++++++++++++++ EEEEEEEEEEEEEE 999999999 ------------------------------------------------ 7777777 666666

Hello, World!

aaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaa aaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaa

You have to do it like this basically.

Interpreter

  • Common Lisp implementation of the Muppp programming language.