49
Esoterische Programmiersprachen Andi Scharfstein, XP Days 2013

Esoterische Programmiersprachen (final) - XP · PDF fileEsoterische Programmiersprachen Dienen vorrangig der Unterhaltung Parodien existierender Sprachen Ausleben absurder Ideen

Embed Size (px)

Citation preview

Esoterische Programmiersprachen

Andi Scharfstein, XP Days 2013

Esoterische Programmiersprachen

Dienen vorrangig der Unterhaltung

Parodien existierender Sprachen

Ausleben absurder Ideen

Chef

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 cream2 pinches baking powder 114 g sugar 111 ml beaten eggs 119 g flour32 g cocoa powder0 g cake mixture

Cooking time: 25 minutes. Pre-heat oven to 180 degrees Celsius.

Rezeptname

Kommentare

(1/3)

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 cream2 pinches baking powder 114 g sugar 111 ml beaten eggs 119 g flour32 g cocoa powder0 g cake mixture

Cooking time: 25 minutes. Pre-heat oven to 180 degrees Celsius.

Variable

Initialbelegung

(1/3)

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.

Lege Variablenwertauf den Stack

do…until(bis Variable 0 enthält)

(2/3)

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. Aufruf einer Subroutine

(2/3)

chocolate sauce.

Ingredients.

111 g sugar108 ml hot water108 ml heated double cream101 g dark chocolate72 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.

Subroutine

Gib Stackinhalt aus

(3/3)

Ook!

Ook! - Hello World

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

Ook!

Since the word „ook“ can convey entireideas, emotions, and abstract thoughtsdepending on the nuances of inflection,

Ook! has no need of comments. The code itself serves perfectly well to describe

in detail what it does and how it does it.Provided you are an orang-utan.

—David Morgan-Mar (Erfinder)

Ook! - Hello World

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

Zwei „Ooks“ = eine Operation

Befunge

Befunge

Design Goal: So schwer wie möglich zu kompilieren

Programm und Daten in zweidimensionalem Array

Programmfluss beliebig: links/rechts/hoch/runter

Befunge - Hello World

> vv , , , , , , " H e l l o " <> 4 8 * , vv , , , , , , " W o r l d ! " <> 2 5 * , @

Befunge - Hello World

> vv , , , , , , " H e l l o " <> 4 8 * , vv , , , , , , " W o r l d ! " <> 2 5 * , @

Auf Stack legenStack ausgeben

Befunge - Hello World

> vv , , , , , , " H e l l o " <> 4 8 * , vv , , , , , , " W o r l d ! " <> 2 5 * , @

Leerzeichen

Newline

Befunge - Hello World

Codefluss

Befunge - Hello World

Code

C o d e f l u s sluss

Befunge - Hello World

Code

C o d e # f f l u s sluss

Trampolin-Operator

Befunge - Hello World

Code

C o d e # f f l u s sluss

Malbolge

Malbolge

Design Goal: So schwer wie möglich zu programmieren

Nach Erscheinen: Zwei Jahre bis zum „HEllO WORld“

Source dafür: ('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>a=<M:9[p6tsl1TS/QlOj)L(I&%$""Z~AA@UZ=RvttT`R5P3m0LEDh,T*?(b&`$#87[}{W

Malbolge - Highlights

Operatoren nicht bitweise, sondern tritweise (ternär)

Bedeutung eines Operators ergibt sich (u. a.) aus seiner Speicheradresse

Operatoren werden nach Ausführung verschlüsselt und das Ergebnis in den Quellcode zurückgeschrieben

Einzige Verknüpfungsmöglichkeit zweier Variablen ist die „Crazy Operation“

Mabolge - Crazy Operation

0 1 2

0 1 0 0

1 1 0 2

2 2 2 1

Malbolge - Highlights

Reaktion des Autors auf erfolgreiche„99 bottles of beer“ Implementierung:

„I think Malbolge needs an update. I may write Visual M++ 2008 Extra Ultimate Edition if I’m feeling bored

some weekend.“

INTERCAL

INTERCAL

Erscheinungsjahr 1972 (eine der ersten esoterischen Sprachen)

„INTERCAL“ steht für „Compiler Language With No Pronounceable Acronym“

INTERCAL - Hello World

DO ,1 <- #13PLEASE DO ,1 SUB #1 <- #238DO ,1 SUB #2 <- #108DO ,1 SUB #3 <- #112DO ,1 SUB #4 <- #0DO ,1 SUB #5 <- #64DO ,1 SUB #6 <- #194DO ,1 SUB #7 <- #48PLEASE DO ,1 SUB #8 <- #22DO ,1 SUB #9 <- #248DO ,1 SUB #10 <- #168DO ,1 SUB #11 <- #24DO ,1 SUB #12 <- #16DO ,1 SUB #13 <- #162PLEASE READ OUT ,1PLEASE GIVE UP

Ohne genügend PLEASE Anweisungenkommt der Fehler: „PROGRAMMER ISINSUFFICIENTLY POLITE“

Zu häufiger Gebrauch von PLEASEresultiert allerdings im Fehler:„PROGRAMMER IS OVERLY POLITE“

INTERCAL - Hello World

DO ,1 <- #13PLEASE DO ,1 SUB #1 <- #238DO ,1 SUB #2 <- #108DO ,1 SUB #3 <- #112DO ,1 SUB #4 <- #0DO ,1 SUB #5 <- #64DO ,1 SUB #6 <- #194DO ,1 SUB #7 <- #48PLEASE DO ,1 SUB #8 <- #22DO ,1 SUB #9 <- #248DO ,1 SUB #10 <- #168DO ,1 SUB #11 <- #24DO ,1 SUB #12 <- #16DO ,1 SUB #13 <- #162PLEASE READ OUT ,1PLEASE GIVE UP Programm beenden

INTERCAL - Highlights

Robustheit: Code mit Syntaxfehler wird als Kommentar interpretiert und einfach ignoriert

Hat kein GOTO-Statement (aber dafür COME FROM)

Piet

Piet - Gallerie

Gibt „Piet“ aus

Piet - Gallerie

Enkodiert Text mit ROT13

Piet - Gallerie

Implementiert „cowsay“

Piet - Gallerie

Approximiert Pi (durch Messung)

Velato

Velato - Hello World