PHL 1.0

Proceed High Language 1.0 (also known as PROCEED) is a mildly esoteric programming language created by User:Fergusq in 2012.

Syntax
There are three syntactical elements: procedure declaration, procedure or function call and a string constant. Everything that is not a declaration or a call is a constant. PHL 1.0 is based on substitution: a declaration is replaced with the name of the procedure and a call is replaced with the return value.

A basic declaration looks like this: procedure[ call1; call2; call3; ... calln ] A procedure can contain an infinite number of calls. No spaces are allowed between The name of the procedure and [. An anonymous function is like a basic declaration but without name.

A call is very similar to a declaration, except that [ and ] are replaced by ( and ). procedure( arg1, arg2, arg3, ... argn ) Again, no spaces should occur between the name and the (.

Example: printsum[ println(The sum of A and B:); println(add(get(A), get(B))) ]

Built-in functions
Commands included in the Javascript interpreter:

Hello World
main[ println(Hello World!) ]

Fibonacci sequence
main[ set(A, 0); set(B, 1); set(C, 0); set(I, 0); loop[ if(get(I)<10, [            set(C, add(get(A), get(B)));             set(A, get(B));             set(B, get(C));             set(I, add(get(I), 1));             println(get(I): get(C));             loop;         ], []); ]; ]

Truth-machine
Uses prompt as the input function ~ change to read if using command line input.

main[ if(prompt==0, [        println(0)     ], [         loop[             println(1);             loop;         ]     ]) ]

Stack
As the main data structure of PHL 1.0 is a hash map, can it be used to simulate a stack (or a queue or everything else).

initStack[ set(stack, 0) ] push[ set(stack, add(get(stack), 1)); set(strCat(stack_, get(stack)), get(value)) ] pop[ set(value, get(strCat(stack_, get(stack)))); set(stack, sub(get(stack), 1)); ]

Example usage:

main[ initStack; set(value, 1); push; set(value, 2); push; set(value, 3); push; pop; println(get(value)); pop; println(get(value)); pop; println(get(value)); ]

Computational class
PHL 1.0 is believed to be Turing complete, but this has not been proved yet.

External resources

 * Javascript PHL 1.0 Interpreter