Pancake is an esoteric programming language that is conceptually split into two worlds -- alpha and omega. But don't worry, those are two sides of the same pancake 😉.
This project was concieved during the first Lang Jam with an amazing team of creative coders:
NOTE: this site is an IDE for our language. Take a look at the Editor section to learn more!
Internally, Pancake runtime is a very simple stack machine that keeps track of the current world in which it's operating. Commands are executed top to bottom (although there are jumps) and if we are in the alpha world, all omega instructions are skipped (and vice versa).
You can
flip
,flip if true
, orflip if false
between the worlds to create conditional statements. That is what makes Pancake so special and yummy!
Here's an example of a simple program with world and stack state annotated for the first pass:
3 ; ALPHA [ 3 ]
{i} ; ALPHA [ 3 {i} ]
bind ; ALPHA [ ] { i = 3 }
i ; ALPHA [ i ] { i = 3 }
@ loop start
flip if false ; ALPHA [ ] { i = 3 }
# loop end ; skipped
"hello world" ; ALPHA [ "hello world" ] { i = 3 }
print ; ALPHA [ ] { i = 3 }
i ; ALPHA [ 3 ] { i = 3 }
1 ; ALPHA [ 3 1 ] { i = 3 }
- ; ALPHA [ 2 ] { i = 3 }
{i} ; ALPHA [ 2 {i} ] { i = 3 }
bind ; ALPHA [ ] { i = 2 }
loop start
@ loop end ; "loop end" is a label to which we can jump
This program will print hello world
three times before halting forever. Here's
what we can learn from looking at it:
- Each line is an instruction.
- Lines prefixed with
@
are lables to which we can jump by writing their name on one of the lines. - Instructions in the alpha world are not prefixed, while omega
instructions have a leading
#
. - Names like
i
can be put on the stack raw, without being evaluated if you wrap them in{ }
. This can be used tobind
a variable or in higher order functions. - All names and their values are stored in a global namespace.
CTRL + ;
= toggle helpCTRL + ENTER
= run source code checks and formattingSHIFT + ENTER
= step through the code (debugger style)
You gotta give credit where credit's due!
- Editor color theme: Gruvbox Material
- Navigation bar: inspired by Elm online editor