MESON

From Esolang
Jump to navigation Jump to search

MESON is an Esoteric Knowledge Representation Format based on ESON. It's name stands for Minimal ESON, but ESON isn't a real acronym. It is child's play to parse.

Design goals

MESON follows the ESON philosophy of being "so easy to parse it melts Nazis' faces and burns out their eyes" and in fact is a strict subset of ESON. It merges ESON's numeric types and prunes the available collections. Like ESON, it is a Turing incomplete language consisting of RPN stack commands.

Program evaluation

The program source code is split on spaces. Control flow iterates through each of the words left to right, performing the appropriate stack operations. At the end of the program, the top of the stack is popped and becomes the result of the evaluation. Any other values on the stack are discarded. Consecutive spaces in the source code can be ignored or throw a syntax error, depending on the implementation.

Commands

Command Meaning
/[0-9_]+/ Push an integer (_ meaningless, can be used to separate digit groups)
/"[^\s]*/ Push a string delimited by the " and a space. Spaces encoded with %20, newlines with %0A, tabs with %09, vertical tabs with %0B and percent signs with %25.
/\(,*\)/ Create a tuple with length(commas)+1 items by popping those items from the stack.
[] POP an integer n, POP n items, PUSH the list composed of those items in the order they were popped.
{} POP an integer n, POP n items, PUSH the set of those items

External Links