Uyku Kaçıran Programlama Dilleri – Ezoterik Diller

Üniversite yıllarımda bir süre programlamayla ilgilenmiştim. Hemen hemen her konuda olduğu gibi bu konuda da “Uçlarda ne var?” merakım, beni oldukça garip programlama dilleriyle buluşturdu. Bu dilleri öğrenmek, nasıl çalıştığını anlamak ve bu dillerde program yazmak gibi konulara ise merakım yetmemiş olacak ki; sadece uzaktan bakmakla yetindim.

“Ne işimize yarayacak?” ya da “Neden böyle bir şey yapalım ki?” sorularını en baştan reddeden bazı programlama challenge’larıyla karşılaşmışsınızdır. “Hiç noktalı virgül kullanmadan Hello world diyebilen bir C programı” gibi.

Eğer siz de bu sorulara “Hiiç, eğlence olsun, öylesine.” ya da “Çünkü yapabiliyorum.” cevaplarını vermeye hazırsanız, sizi bu tarz programlama dillerinin bir listesiyle baş başa bırakmak istiyorum.

Rockstar Developer (https://codewithrockstar.com/swag)
Rockstar Developer (https://codewithrockstar.com/swag)

Bu listede yer alacak programların bazıları, web’te daha önce karşılaştığım çalışmalar. Bazıları ise, Dylan Beattie’nin NDC Conference’ta yapmış olduğu “The Art of Code” konuşmasından.

Bu 1 saatlik konuşmayı mutlaka izlemelisiniz. Gerçek anlamda bir gösteri ortaya koymuş. Ek olarak, listedeki dillerden bir tanesini ise kendisi oluşturmuş. Bu tarz dillere “ezoterik programlama dilleri (esoteric programming languages, esolang)” deniliyor. Programlama dillerinin yapılarındaki sınırları zorlamak, hack kültürünü yaşatmaya devam etmek, sanat ya da eğlence gibi amaçlar taşıyor bu diller.

Başlamadan önce bir daha hatırlatayım isterim. Gerçekten hiç noktalı virgül kullanmadan, ekrana “Hello world” yazabilen bir C programı yazabilir misiniz?

Ook!

Bazı kıymetli arkadaşlarınıza müjdeyi verebilirsiniz. Bu programlama dili, orangutanlar için, David Morgan-Mar tarafından hazırlandı. Tasarım prensipleri ise gayet basit. Orangutanlar bu dili kullanabilmeli. Asla ama asla “maymun” kelimesinden bahsedilmemeli. Muz iyidir.^1

Orangutanların “ook”uyla çok fazla iletişim kuramayacakları düşünülmüş olsa gerek, bu dilde “yorum satırı” olgusu yok.

Komutları ise oldukça ilkel görünüyor. Bir de “Hello world!” örneği buldum. Onu da komutların altında bulabilirsiniz:^2

KomutAçıklama
Ook. Ook?Pointer’ı sağa taşı
Ook? Ook.Pointer’ı sola taşı
Ook. Ook.Pointer’ın gösterdiği bellek hücresini arttır
Ook! Ook!Pointer’ın gösterdiği bellek hücresini azalt
Ook! Ook.Pointer’ın gösterdiği hücredeki karakteri yaz
Ook. Ook!Bir karakter al ve pointer’ın gösterdiği hücreye yaz
Ook! Ook?Pointer’ın gösterdiği hücre sıfırsa, bir sonraki “Ook? Ook!”a geç
Ook? Ook!Bir sonraki “Ook! Ook?”a geç.
Ook! dili komutları

Ook! dilinde Hello World örneği:

Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.

Brainfuck

1993 yılında Urban Müller tarafından geliştirilmiş bir dildir. Bu dilin konseptinde birçok farklı dil de geliştirilmiştir. Yukarıda örneğini verdiğimiz Ook! da olmak üzere.

Bu dilin temelde 8 komutu vardır. Bu komutların işlevleri, Ook! bölümünde verdiğim tabloya benzerdir. Fakat komut olarak “>, <, +, -, ., ,, [ ve ] kullanılmaktadır.^3

Yorumlarıyla birlikte bir “Hello World!” örneği buldum. Aynı kodun, bir de kısaltılmış hâlini paylaşıyorum:^4

 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
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Adının hakkını veriyor.

Shakespeare

Shakespeare Programming Language (SPL), kaynak kodlarının Shakespeare oyunları gibi göründüğü bir programlama dilidir. 2001 yılında Karl Wiberg tarafından tasarlanmıştır.^5

İşte size bir “Hello world” örneği:^6

Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Ophelia.

                      Act I: Hamlet’s insults and flattery.
                   Scene I: The insulting of Romeo.

[Enter Hamlet and Romeo]

Hamlet:

You lying stupid fatherless big smelly half-witted coward! You are as
stupid as the difference between a handsome rich brave hero and thyself!
Speak your mind!
You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer’s
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!
You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.
Speak your mind!

[Exit Romeo] 

                  Scene II: The praising of Juliet.

[Enter Juliet]

Hamlet:

Thou art as sweet as the sum of the sum of Romeo and his horse and his
black cat! Speak thy mind!

[Exit Juliet]

                   Scene III: The praising of Ophelia.

[Enter Ophelia]

Hamlet:

Thou art as lovely as the product of a large rural town and my amazing
bottomless embroidered purse. Speak thy mind!
Thou art as loving as the product of the bluest clearest sweetest sky
and the sum of a squirrel and a white horse. Thou art as beautiful as
the difference between Juliet and thyself. Speak thy mind!

[Exeunt Ophelia and Hamlet]

                        Act II: Behind Hamlet’s back.
                   Scene I: Romeo and Juliet’s conversation.

[Enter Romeo and Juliet]

Romeo:

Speak your mind. You are as worried as the sum of yourself and the
difference between my small smooth hamster and my nose. Speak your
mind!

Juliet:

Speak YOUR mind! You are as bad as Hamlet! You are as small as the
difference between the square of the difference between my little pony
and your big hairy hound and the cube of your sorry little
codpiece. Speak your mind!

[Exit Romeo]

                   Scene II: Juliet and Ophelia’s conversation.

[Enter Ophelia]

Juliet:

Thou art as good as the quotient between Romeo and the sum of a small
furry animal and a leech. Speak your mind!

Ophelia:

Thou art as disgusting as the quotient between Romeo and twice the
difference between a mistletoe and an oozing infected blister! Speak
your mind!
[Exeunt]

Whitespace

Edwin Brady ve Chris Morris tarafından 2003 yılında geliştirilen whitespace dili, adından da anlaşılabileceği üzere, boşluk, tab, yeni satır karakterlerini kullanarak kod yazabilmenizi sağlayan bir dildir.^7

Komutlar, bir “instruction modification parameter (IMP)” ve onu takip eden bir işlem şeklinde verilmektedir. Örneğin; “[Tab][Space]” ifadesi, matematiksel bir işlem yapılacağını ifade eder. Takip eden “[Space][Space]” ise bu işlemin “toplama” olduğunu gösterir.

“Hello, world!” örneği ise şu şekilde. Tabii ki karakterleri göremeyeceğimiz için karşılıklarını yazmışlar: Space, tab ve line feed:^8

Hello,[Space]world![Space][Space][Tab][Space][Space][Tab][Space][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Space][Tab][Space][Tab][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Tab][Tab][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Space][Tab][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Space][Space][Space][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Tab][Space][Tab][Tab][Tab][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Tab][Tab][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Tab][Space][Space][Tab][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Tab][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[Space][Space][Space][Tab][Tab][Space][Space][Tab][Space][Space][LF]
[Tab][LF][Space][Space]
[LF][LF][LF]

Aşağıdaki örnekte ise, tablar mavi ve boşluklar kırmızı olacak şekilde renklendirilmiş:

Whitespace dilinde "Hello world" örneği
Whitespace dilinde “Hello world” örneği

Chef

2002 yılında David Morgan-Mar tarafından geliştirilen Chef, bilgisayarların dışında da kullanabileceğiniz bir programlama dili.^9

Bu dilin kaynak kodları, mutfakta kullanabileceğiniz yemek tarifleri gibi görünüyor. Dilin tasarımcısı David Morgan-Mar, doğru çıktıyı veren bir Hello world programı yazmıştı. Ancak sonuçta çıkacak yemekten pek de memnun olmayan Mike Worth, yeni bir Hello world programı yazdı. Bu programın kaynak kodlarını mutfakta uyguladığınız zaman ise çikolata soslu kek yapmış oluyorsunuz.:^10

Hello World Cake with Chocolate sauce.

This prints hello world, while being tastier than Hello World Souffle. The main
chef makes a " world!" cake, which he puts in the baking dish. When he gets the
sous chef to make the "Hello" chocolate sauce, it gets put into the baking dish
and then the whole thing is printed when he refrigerates the sauce. When
actually cooking, I'm interpreting the chocolate sauce baking dish to be
separate from the cake one and Liquify to mean either melt or blend depending on
context.

Ingredients.
33 g chocolate chips
100 g butter
54 ml double cream
2 pinches baking powder
114 g sugar
111 ml beaten eggs
119 g flour
32 g cocoa powder
0 g cake mixture

Cooking time: 25 minutes.

Pre-heat oven to 180 degrees Celsius.

Method.
Put chocolate chips into the mixing bowl.
Put butter into the mixing bowl.
Put sugar into the mixing bowl.
Put beaten eggs into the mixing bowl.
Put flour into the mixing bowl.
Put baking powder into the mixing bowl.
Put cocoa  powder into the mixing bowl.
Stir the mixing bowl for 1 minute.
Combine double cream into the mixing bowl.
Stir the mixing bowl for 4 minutes.
Liquify the contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
bake the cake mixture.
Wait until baked.
Serve with chocolate sauce.

chocolate sauce.

Ingredients.
111 g sugar
108 ml hot water
108 ml heated double cream
101 g dark chocolate
72 g milk chocolate

Method.
Clean the mixing bowl.
Put sugar into the mixing bowl.
Put hot water into the mixing bowl.
Put heated double cream into the mixing bowl.
dissolve the sugar.
agitate the sugar until dissolved.
Liquify the dark chocolate.
Put dark chocolate into the mixing bowl.
Liquify the milk chocolate.
Put milk chocolate into the mixing bowl.
Liquify contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
Refrigerate for 1 hour.

Piet

Kaynak kodlarının soyut resimler olarak görüldüğü Piet, David Morgan-Mar tarafından geliştirilmiştir. Adını, geometrik soyut resimler yapan Hollandalı ressam Piet Mondrian’dan almıştır.^11

Tüm programlama, 20 renk ve bu renklerin – beyaz ve siyah hariç – hue ve lightness değerleriyle yapılır. Komutlar, renk geçişleri ve renklerin anlamlandırılmasıyla işletilir.^12

Thomas Schoch tarafından yazılmış (ya da bu durumda çizilmiş?) bir Hello world örneğini aşağıda paylaşıyorum. Kodun çalışma mantığını da detaylıca açıklamış:^13

Piet dilinde Hello world örneği (Thomas Schoch)
Piet dilinde Hello world örneği (Thomas Schoch)

Rockstar

Gelelim bu yazıyı yazma zorunluluğu hissetiren kişiye ve onun geliştirdiği dile. Hikayesini kendisinden dinlemenizi isterim. Bu nedenle en başta linkini verdiğim videoyu lütfen izleyin.

“Rockstar developer” arayan kurumlara bir tepki olarak doğmuş bu dil. “İşin piri olmuş developer arıyoruz, rockstar developer arıyoruz.” cümlesine tokat gibi gelmiş. Çünkü artık ortada Rockstar diye bir dil var ve bu dilde yazılım geliştiren kişiler de Rockstar developer oluyor. Güzel hack.^14

Bu dilde yazılan programların kaynak kodları, şarkı sözü olarak karşımıza çıkıyor. 1980’lerin hard rock ve power ballad sözlerinden esinlenen bu dil, Paul Stovell’in attığı bir tweet’ten etkilenen Dylan Beattie tarafından 2018 yılında geliştirildi.

Hello world örneği epey basit kalacak diğerlerinin yanında:

Say "Hello World"

Ancak nispeten uzun bir örnek verelim, FizzBuzz:

Midnight takes your heart and your soul
While your heart is as high as your soul
Put your heart without your soul into your heart

Give back your heart


Desire is a lovestruck ladykiller
My world is nothing 
Fire is ice
Hate is water
Until my world is Desire,
Build my world up
If Midnight taking my world, Fire is nothing and Midnight taking my world, Hate is nothing
Shout "FizzBuzz!"
Take it to the top

If Midnight taking my world, Fire is nothing
Shout "Fizz!"
Take it to the top

If Midnight taking my world, Hate is nothing
Say "Buzz!"
Take it to the top

Whisper my world

Sonuç böyle bir şey çıkıyor 🙂

Bağlantılar

1- Ook!, https://www.dangermouse.net/esoteric/ook.html

2- Ook!, https://esolangs.org/wiki/Ook!

3- Brainfuck, https://en.wikipedia.org/wiki/Brainfuck

4- Brainfuck, https://esolangs.org/wiki/Brainfuck

5- Shakespeare Programming Language, http://shakespearelang.com/

6- Shakespeare Programming Language, https://www.carleton.edu/ocs/london/news/shakespeare-programming-language/

7- Whitespace (programming language), https://en.wikipedia.org/wiki/Whitespace_(programming_language)

8- Whitespace, https://esolangs.org/wiki/Whitespace

9- Chef, https://esolangs.org/wiki/Chef

10- Baking a Hello World Cake, https://www.mike-worth.com/2013/03/31/baking-a-hello-world-cake/

11- Piet, https://esolangs.org/wiki/Piet

12- Piet, https://www.dangermouse.net/esoteric/piet.html

13- “Hello, world!” in Piet, http://www.retas.de/thomas/computer/programs/useless/piet/explain.html

14- Rockstar, https://codewithrockstar.com/