o [About] o [Usage] o [Whitespace] o [Assembly] o [Optimizer]
About [top] ===== Whitelips is an online IDE for Whitespace. [top]
Whitespace [top] ========== TODO! [top]
Assembly [top] ======== As there is no official standard, Whitelips features it's own assembly language. Care has been taken to make it compatible with others, but this has never been a goal.
push $n - Push value $n onto the stack. dup - Duplicate the topmost stack element. copy $n - copies the $n-th element from stack, where 0 is the topmost value. swap - swap two topmost stack elements. drop - discards the topmost stack value. slide $n - keeps the topmost element, and deletes the next $n elements. add - sub - mul - div - mod - store - retrieve - label $l - call $l - jmp $l - jz $l - jn $l - ret - end - Terminate the program. printc - printi - readc - readi - Where: $n - an integer parameter. $l - a label. [top]
Optimizer [top] ========= The main philosophy behind the optimizer is that all Whitespace instructions are equally slow. This means that all optimizations are made to reduce the number of instructions. Optimizer guarantees that the number of instructions in the output is less or equal to the original program. As a secondary objective, the optimizer tries to reduce the size of the program to speed up parsing. The optimizer does not guarantee that the output code is smaller or equal in bytes compared to the initial program. The optimizer works on the Whitespace instruction level, which means the assembly programs can not be optimized directly - they have to be compiled into Whitespace. This is a serious restriction by design. Rules: * Remove unreachable code. * Inline unconditional jumps, if possible. * Inline function calls. * Remove unused and duplicate labels. * Mimimize label names by usage in the program. [top]