More than a thousand programming languages have been invented and only about one hundred of them are commonly used. Among these, there are some weird ones, so labeled because of their syntax and the way it represents its code. In this article, we will look into some of these languages and syntax.
Have you ever landed on a Github project that prints “hello world” program, but without any visible code or any content. Check this link https://github.com/blinry/legit-hello and you will see nothing in this repository. But trust me, there is hidden code in this project.
If you see the commit section, you can reveal the magic. It’s storing the “hello world” code inside git commit history. If you clone this project and run the following command, then you can see the hidden code in this project.
git log --graph --oneline
Here are the supported instructions.
Legit programming language source code hosted in Github and you can try out yourself. Read out more about Legit.
Here’s another one which does not maintain any code inside its repository. This language keeps its code as folders. Instructions are read according to the order of the folders. Inside these folders, there are three folders to represent Type, Command, and Expression. The number of folders in inside these folders represent relevant mapping with type, command or expression.
Read full description of this language in here
This is another interesting programming language which represents its code in two-dimensional space. Take a look following code of infinite loop.
>v
^<
Did you get that? Execution starts with the first line “>” character. It means to execute the next instruction on the right side, and the right side instruction is “v”. This means to execute down instruction. This continues as an infinite loop. Here I added some of its instructions.
Read complete language specifications here. 3D represented languages also built called “Suzy” based on this language. Here below an example of finding factorial with Befunge language
&>:1-:v v *_$.@
^ _$>\:^
This language was invented in 1993, as an attempt to create the smallest possible compiler. This compiler allows only eight commands to write a program and operate based on memory cell which is also known as tapes. Here is the list of command Brainfuck supports.
Here below how hello world application implemented in Brainfuck language.
1 +++++ +++ Set Cell #0 to 8
2 [
3 >++++ Add 4 to Cell #1; this will always set Cell #1 to 4
4 [ as the cell will be cleared by the loop
5 >++ Add 4*2 to Cell #2
6 >+++ Add 4*3 to Cell #3
7 >+++ Add 4*3 to Cell #4
8 >+ Add 4 to Cell #5
9 <<<<- Decrement the loop counter in Cell #1
10 ] Loop till Cell #1 is zero
11 >+ Add 1 to Cell #2
12 >+ Add 1 to Cell #3
13 >- Subtract 1 from Cell #4
14 >>+ Add 1 to Cell #6
15 [<] Move back to the first zero cell you find; this will
16 be Cell #1 which was cleared by the previous loop
17 <- Decrement the loop Counter in Cell #0
18 ] Loop till Cell #0 is zero
19
20 The result of this is:
21 Cell No : 0 1 2 3 4 5 6
22 Contents: 0 0 72 104 88 32 8
23 Pointer : ^
24
25 >>. Cell #2 has value 72 which is 'H'
26 >---. Subtract 3 from Cell #3 to get 101 which is 'e'
27 +++++ ++..+++. Likewise for 'llo' from Cell #3
28 >>. Cell #5 is 32 for the space
29 <-. Subtract 1 from Cell #4 for 87 to give a 'W'
30 <. Cell #3 was set to 'o' from the end of 'Hello'
31 +++.----- -.----- ---. Cell #3 for 'rl' and 'd'
32 >>+. Add 1 to Cell #5 gives us an exclamation point
33 >++. And finally a newline from Cell #6
This can be represented in one line as follows.
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
As you see it, it is a programming language where the programmer needs to color a grid instead of coding words. Pointer used to move around the bitmap image and execute command relevant to each color code. There are twenty colors used to represent command and white color does not represent any operation. when the pointer tries to enter a black region, the rules of choosing the next block are changed instead. Here below the sample program to print “Piet”.
Last but not least, this language is known as “Programming from hell”. The idea is that programming should be hard. Therefore, there is no point in discussing language syntax any further. An interesting fact of this language is that even the inventor of this language could not write a program by himself. However, Here an example program of hello world in Malbolge language.
(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc
I have listed down below other programming languages that I have found for further reading. An interesting fact about most of these languages was these are Turing complete, meaning you can implement any computer program that other programming languages can do. Even though these programming languages seem useless, it opens our minds to look at things differently.
Hope you enjoy reading this article. If you have any comment, you can find me on Twitter. Follow me for more interesting stories. Feel free to comment down your thoughts. See you in another article. Cheers :)