AAEEEEEEEEEI

From Esolang
Jump to: navigation, search

AAEEEEEEEEEI [a:e:i] is an esoteric programming language to redefine the term for "stupid programming language". It is made by user:Jabutosama. Even tough it's possible to write programs with it, one should be advised to not unless they are willing to do self-harm to their mental state. It is functional language.


Properties

AAEEEEEEEEEI has no single goal to exist for other than being really hard and annoying to be worked with. Again, it is not advised not to use it in any way for other than impressing others.

Each program will use it's functional syntax and properties to result in single number. Each dummy function called in the first function adds 1 to the program counter which is in the end the final output.

Name Rule

AAEEEEEEEEEI is compiled language whose source code is written in binary format. Compiler only accepts files with following rules to it's name:

  • At least 8 symbols
  • At least 1 capital letter and 2 numbers
  • No more than 1 capital letters and no non-english symbols
  • No duplicate characters

File extension is not restricted to anything in peculiar but is counted as part of the name.

Metadata Rule

Compiler only accepts read-only files to it's input and runs "Hello World!" script instead of compiling in case this rule is violated.

Also, any metadata the file has is added to top the code itself. This makes scripting really hard with it. Essentially metadata's binary form must be checked to not crash the program in order any program to work. Because timestamp is part of it, saving time of the program is essential to be exactly right. This could be worked over with metadata-editors.

Functionality

AAEEEEEEEEEI is mostly functional language, meaning most problems are to be tackled with associating functions and defining new ones. Each function may have up to 8 sub-functions, but having so many may prevent the calls of the functions. Functions are referred to with simply it's order in definition, and sub-functions will be added "locally" to the tail of the order.

AAEEEEEEEEEI automatically considers duplicate lines and characters to be mistakes, and interpreters such cases the first only once, skipping the other.

Syntax

Commands are written in 5-bit format. If the system wants to decode the file as powers of 2, like 8-bit words, one simply has to make the program length long enough to match it manually. Language does not allow comments. Following text next to bytes is for explanation only and does not have correspondance in the language.

To declare a dummy function, flag 00001 defines a function start and 00010 marks "return" value.

00001 00010 (spaces added for clearance)

Such function takes no input. These are used mostly to increment the program counter to vary the final outcome of the program. Simplest way to diverge from this is to add an input possibility. Flag 00011 refers to single input. It have to has to be right before the function start flag. Without being followed by a legitimate function declaration, they will result in error.

00011 00001 00010

This is a correct function, which returns now instead its input. Flags 00100, 00101, 00111 refer to two, four and eight-argument inputs and use the same syntax. These can be stacked before function call for higher number of inputs. They must, however, be in numerical order. Functions always return all of their inputs, if not specified otherwise.

Now that we have an function, me can implement it's behavior with command flags; swap 01100, mutate 01101, banish 01110 and spiral 01111. These are put between start and end of the function call. Multiple commands may be chained together, but it is to be remembered that duplicates are jumped over.

00100 00001 01100 00010 (uses swap, rotating inputs one to right, last input becoming one)
00100 00001 01101 00010 (mutate turns all inputs to same as the first one)
00100 00001 01110 00010 (banish removes the last input)
00100 00001 01111 00011 (spiral replaces last input, with result of it put to itself)

Final thing the language is able to do is to is to refer to other functions. call 00000 is used to call other functions, followed by any 5-bit sequence starting with 1. These refer anonymously to nth defined function, such as 10000 refering to the first function and 10001 to second. Misuse of refering to nonexistent-nth function causes an error. Declaring functions inside functions exist only in their definition. This may change their local scope; defining a new function inside function which is considered as the third will cause the fourth to be the said new one, but outside the function fourth one does not yet exist. Because the function knows all functions defined in it's scope regardless of order, it is adviced not to make too many functions. This allows for many "local" functions to be made inside them, as referring to function can only refer to 8th function and maximum.

00001
  00110 00001
    01111 00010 01111
  00010
  00011 00001
    00000 10100
  00010
  00000 10001
00011

The code above will return 4. It declares a sub-function which takes two arguments and applies both of them to themselves. It also creates a third function, which is used to call a dummy function. After this it calls the second function with two third ones, simply adding 1 four times.

The logic may seem simple at first but be warned, it is nothing but simple.