The world's shortest 'Hello World!' program: a proposal

R

Rocco Caputo

My proposal for Perl6 is to make Perl execute a sequence of code which
is 0 bytes in length with the action of printing to STDOUT:

Hello World

You can get the solution down to 1 byte by writing a HQ9+ compiler for
Parrot. Please see http://www.cliff.biffle.org/esoterica/hq9plus.html
for the language specification.

If you want to reduce the solution to 0 bytes, simply specify a
language where this happens and write the appropriate Parrot compiler
for it.

Whereas Perl 6 doesn't currently exist, and the language designers may
consider such features frivolous, Parrot DOES exist, and people are
encouraged to write compilers for it.

I think your are not serious about your proposal, or you would already
be working on it.
 
I

Ilya Zakharevich

[A complimentary Cc of this posting was sent to
Rocco Caputo
You can get the solution down to 1 byte by writing a HQ9+ compiler for
Parrot. Please see http://www.cliff.biffle.org/esoterica/hq9plus.html
for the language specification.

If you want to reduce the solution to 0 bytes, simply specify a
language where this happens and write the appropriate Parrot compiler
for it.

Whereas Perl 6 doesn't currently exist, and the language designers may
consider such features frivolous, Parrot DOES exist, and people are
encouraged to write compilers for it.

I think your are not serious about your proposal, or you would already
be working on it.

Would the guy be 1/3-satisfied if we include h.pm into distribution
with one line in it?

print "Hello, world\n" and exit;

Then

perl -Mh

would do what he wants...

Just trying to be helpful,
Ilya
 
W

Wes Groleau

A. Sinan Unur said:
Actually, that is "Garbage in, garbage out"

I was merely trying to steer the thread back to its
original tongue-in-cheek intent.

--
W. Wesley Groleau

Guidelines for judging others:

1. Don't attribute to malice that which
can be adequately explained by stupidity.

2. Don't attribute to stupidity that which
can be adequately explained by ignorance.

3. Don't attribute to ignorance that which
can be adequately explained by misunderstanding.
 
C

chris-usenet

Ilya Zakharevich said:
Would the guy be 1/3-satisfied if we include h.pm into distribution
with one line in it?
print "Hello, world\n" and exit;

But that's not the canonical "hello, world", is it. Let's at least get
this right first!

OTOH, shouldn't it really be JAPH anyway?

Chris
:)
 
D

David H. Adler

You can get the solution down to 1 byte by writing a HQ9+ compiler for
Parrot. Please see http://www.cliff.biffle.org/esoterica/hq9plus.html
for the language specification.

Although it's not a compiler, there does exist an interpreter for HQ9+
in parrot.

http://www.thetasigma.com/parrot/

It seems to have developed a subtle bug or two with recent releases of
parrot, but for the purposes of this thread, it should work fine.

dha

--
David H. Adler - <[email protected]> - http://www.panix.com/~dha/
Your pluck is admirable. However, arguing for a 'pure computer
science' approach in the perl5-porters mailing list is somewhat like
inquiring about mileage in a Maserati dealership. People are given to
drop their champagne glasses and stare. - Felix Gallo, p5p
 
M

Michele Dondi

I'm quitting this thread since IMO it's stupid to argue about whether an
empty string is a program.

Well: not an attempt to revamp a hopefully dead thread, but just in
case after all you're still following it, be it stupid or not I hadn't
the impression that anybody was arguing _wether_ an empty string is a
program. In fact in Perl (that is) it _is_ a valid program, period.
You can think what you like of this circumstance, but it is not so
obvious, since it is definitely not true of other languages.


Michele
 
M

Michele Dondi

[Note: I had begun following up to the referenced post either before
or shortly after the announce of my leaving, so I'm posting this just
for completeness... ;-) ]

X-Newsreader: Microsoft Outlook Express 6.00.2900.2180

This line tells that you're using a real newsreader[*] (even if
others' opinion may vary!) so you can properly quote messages you
reply to. It is important to include quotes and attributions to
underline clearly what one is referring to.
I think the _original_ point was that if you had "script.pl" and that
contained _no_ data, instead of doing nothing, the Perl Interpreter cheekily
outputted "Hello World!" or something.

Ouch, (the original text was so convoluted[**] that) I must admit I
hadn't understood that.
Let us not argue! :D

I don't think anybody was arguing. And _really_ this is not an attempt
at reviving that thread...


[*] As opposed (e.g.) to the web interface from Google groups that is
causing some problems nowadays, (but really the new "Beta" version is
already working properly even if by means of a slightly awkward
mechanism, IMHO).

[**] At least that is a nice excuse!


Michele
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top