Filed under: Blog, Code, Lemurs | Tags: APL, Blog, Brainfuck, Hello World, programming
All code should begin with a “Hello World” application to show the codes syntax and explain it’s semantics. Of course most programming languages have a similar syntax and semantic for the most basic functions, i.e. the functions used for a “Hello World” application, so the example rarely gives the viewer an idea about what to expect from the language. There are some exceptions to this rule, like Brainfuck.
“Hello World!” in Brainfuck
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
This “Hello World!” application makes sure you know your brain will be severly fucked up if you ever try writing large applications in Brainfuck.
Another weird programming language is APL which doesn’t even use normal ASCII characters. Nor is it interpreted as one would expect, APL is read from right to left without function or operator precedence. Yet if you look at a “Hello World” application in APL you wouldn’t know that.
“Hello World!” in APL
'Hello World!'
APL isn’t a joke, it is in use at large corporations. Why? Because of legacy applications and because it is a very powerful, expressive and concise language when working with math, science, engineering and other computation rich areas of expertise. This code (∼R∈R∘.×R)/R←1↓⍳R finds all prime numbers from 1 to R. To find out how I refer you to the Wikipedia link for APL supplied above.
So why did I force you to read through all that? Well, so you would appreciate the importance of this my first post and my “Hello World!” of blogging.
2 Comments so far
Leave a comment
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Always good to start with a solid foundation and a big smile on your face as you great the world. I understand the notion on comparing brainfuck with APL but there is a major difference where brainfuck is more or less a joke APL as you state is a used langauge. Whats even more impressive is that APL is a live langauge that is still developing, late additions to the language include OO and conversion of internal code to unicode to make is possible to see all those pesky APL characters in a plain text editor.
Comment by Sheepster 2008-02-01 @ 11:23Yes, I know. It’s all your fault that I ever saw APL in the first place.
Comment by The Drunken Lemur 2008-02-01 @ 19:42