‹Back


gillian

  Source

# Print the first 100 Fibonacci numbers
$ echo 'p1pC{2P+' | gillian

0
1
1
2
3
5
8
13
21
34
55
89
144
233
377
610
987
1597
...

About

Code golf is a type of programming where the goal is to solve a problem using the smallest amount of source code possible. Many people have created their own programming languages for this specific purpose – an elite, prestigious club that I am now a proud member of.

My entry is called gillian. It’s a stack-based language, with various inspirations. Each character is a command that operates on that stack. With some clever tricks and a bit of puzzle-solving, you can create surprisingly concise programs.

Let’s take a look at the above example p1pC{2P+ to see how this works, character by character:

When the program terminates, the values on the stack are printed, one per line, giving us our Fibonacci sequence!

The fun of this project is just in the design of the language – determining the syntax, coming up with valuable commands, trying to reduce duplicate ways of doing the same thing, and making it feel rewarding to solve problems with it.