Hello World Programs in 300 Programming Languages(mycplus.com)
mycplus.com
Hello World Programs in 300 Programming Languages
http://www.mycplus.com/featured-articles/hello-world-programs-in-300-programming-languages/
11 comments
Brainfuck was missing. Here is Hello World in brainfuck
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.>>>++++++++[<++++>-]
<.>>>++++++++++[<+++++++++>-]<---.<<<<.+++.------.--------.>>+.And it's all copyrighted by Oracle -- http://docs.oracle.com/javase/tutorial/getStarted/applicatio...
JavaDoc bug. Also prints newline.
The intention behind "Hello, world!" was to show the steps you need to run your code. In C's case: compiling it.
These examples just show some silly code, without any further information.
It would be really interesting to see how some languages deploy.
These examples just show some silly code, without any further information.
It would be really interesting to see how some languages deploy.
I agree, here is my related take on the meaning of "hello world" http://www.win-vector.com/blog/2008/02/hello-world-an-instan...
Rosetta Code has Hello World in only 245 programming languages (but a huge corpus of other examples in various languages).
http://rosettacode.org/wiki/Hello_world
PHP ones are wrong. Hello world in PHP is this:
Hello world!
Hello world!
Yup, people often miss that PHP is modal and that the default mode is simply to output. So if you put Hello World in a file it actually compiles to these opcodes:
ECHO 'Hello+World%0A'
RETURN 1
Which is identical to the opcodes produced by putting <?php
echo "Hello World"; ?> into a file.No, it's not identical.
$ echo -n "<?php echo 'Hello World'; ?>" > hello.php
$ php -d vld.active=1 -d vld.execute=0 -f hello.php
line # * op fetch ext return operands
---------------------------------------------------------------------------------
1 0 > ECHO 'Hello+World'
1 > RETURN 1
$ echo -n "Hello World" > hello.php
$ php -d vld.active=1 -d vld.execute=0 -f hello.php
1 0 > ECHO 'Hello+World'
1 > RETURN 1
$ echo "<?php echo 'Hello World'; ?>" > hello.php
$ php -d vld.active=1 -d vld.execute=0 -f hello.php
1 0 > ECHO 'Hello+World'
2 1 > RETURN 1
$ echo "Hello World" > hello.php
$ php -d vld.active=1 -d vld.execute=0 -f hello.php
2 0 > ECHO 'Hello+World%0A'
1 > RETURN 1
PHP 5.3.10-1ubuntu3.6 / Zend Engine v2.3.0 / vld-0.11.2A bit off-topic, but the site locks up Chrome on Snow Leopard and causes one my cores to peak, and I'm forced to eventually kill the tab. Firefox has no problems. Any ideas why that might be?
Otherwise, a fun read-through.
Otherwise, a fun read-through.
AS3 example creates class with a method but doesn't call the method. Also it subclasses a sprite but then uses trace (console log). Fractally bad.
JavaScript example is wrong:
<a href="#">Hello World Example</a>none of the JavaScript ones even work in Node.js, I'd probably consider
console.log('Hello, world!');
to be the closest to universal one.Some implementations don't define console, so this wouldn't work in some (for example, Rhino).
Something like this would be more universal:
Something like this would be more universal:
if (typeof console === 'object') {
console.log('Hello, World!');
} else if (typeof document === 'object') {
document.write('Hello, World!');
} else {
print('Hello, World!');
}
http://progopedia.com/implementation/rhino/god damn rhinoceruses fucking everything up.
[deleted]
Sad to see brainfuck missing :/
99 Bottles is a similar, if slightly more complex, thing. Brainfuck included!
http://www.99-bottles-of-beer.net/
http://www.99-bottles-of-beer.net/
99 Bottles is way better because it covers iteration. FizzBuzz is even better because 99 Bottles emphasizes string handling a bit much.
But it has 1500 different programming languages, which is FAR more impressive (whitespace included =D)
This was my first reaction, too! ;-)
Here's Wikipedia's example 'Hello, World!' program: http://en.wikipedia.org/wiki/Brainfuck#Hello_World.21
Here's Wikipedia's example 'Hello, World!' program: http://en.wikipedia.org/wiki/Brainfuck#Hello_World.21
actually the code for ruby is even simpler:
"Hello world"
"Hello world"
For example: http://rosettacode.org/wiki/Hello_World
Plus, I enjoyed learning the word "chrestomathy", which "from the Greek words khrestos, useful, and mathein, to know, is a collection of choice literary passages, used especially as an aid in learning a subject."