Home

Awesome

Whitespace

A whitespace compiler for R

1.1 About the language

Whitespace is an imperative, stack based esoteric regular programming language. It only allows three symbols: [Space](" ","S"), [Tab]("\t","T") and [Newline]("\n","L"), which makes the source code invisible.

1.2 Syntax

The full documentation can be found here: http://compsoc.dur.ac.uk/whitespace/tutorial.html, but here is a general breakdown:

[Instruction Modification Parameter][Command][Parameter ended by L]

1.2.1 Instruction Modification parameter

Here is a nicer and more intuitive representation:

Whitespace parser

1.3 Installation

Simply do:

install.packages("devtools")
library(devtools)
install_github("artificialbreeze/whitespace")

1.4 Use

Create a DFA (Deterministic Finite-State automaton) with code=your code argument:

dfa1=dfa("   \t\t\t\t\t\t\n\t\n  \n\n\n")

Now, parse the syntax:

dfa1.parsed=parse(dfa1)

Finally, compile and run the example:

dfa1.compiled=compile(dfa1.parse)

The above code should output:

# Program output:  ?
# Program stop