Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > The world's shortest 'Hello World!' program: a proposal

Reply
Thread Tools

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

 
 
Larry
Guest
Posts: n/a
 
      01-18-2005
Having a superlative description of a language is a great promotional
aid. For example: "best at text processing", "best for distributed web
apps", "fastest for 3d games" etc...

One claim that Perl can make is one of the most simple and shortest
'Hello World' programs.

There is rumor on the web that there is another language which will
execute the code:

Hello World

and print:

Hello World

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

Currently, attempting to execute a file or string of code with no
content will do absolutely nothing.

Of course, with the -W flag, Perl would continue to do nothing, and if
one were to use strict, it would no longer be an empty file and
therefore would properly execute by strictly doing absolutely nothing.

The controversy in this proposal may be the way in which to state:

Hello World

Here are a few alternatives that have been used traditionally:

Hello, World
Hello, World!
Hello world.
hello world...

And with the current aggressiveness of Nasa in exploring new worlds,
one might consider changing it to:

Hello Worlds!

 
Reply With Quote
 
 
 
 
Ken
Guest
Posts: n/a
 
      01-18-2005
Larry wrote:
> Having a superlative description of a language is a great promotional
> aid. For example: "best at text processing", "best for distributed web
> apps", "fastest for 3d games" etc...
>
> One claim that Perl can make is one of the most simple and shortest
> 'Hello World' programs.
>
> There is rumor on the web that there is another language which will
> execute the code:
>
> Hello World
>
> and print:
>
> Hello World
>
> 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
>
> Currently, attempting to execute a file or string of code with no
> content will do absolutely nothing.
>
> Of course, with the -W flag, Perl would continue to do nothing, and if
> one were to use strict, it would no longer be an empty file and
> therefore would properly execute by strictly doing absolutely nothing.
>
> The controversy in this proposal may be the way in which to state:
>
> Hello World
>
> Here are a few alternatives that have been used traditionally:
>
> Hello, World
> Hello, World!
> Hello world.
> hello world...
>
> And with the current aggressiveness of Nasa in exploring new worlds,
> one might consider changing it to:
>
> Hello Worlds!
>


lol (this IS a joke, right?)

Ken

 
Reply With Quote
 
 
 
 
Leonard Challis
Guest
Posts: n/a
 
      01-18-2005
"Ken" <x3v0-> wrote in message
news:gXeHd.59$...
> Larry wrote:
>> Having a superlative description of a language is a great promotional
>> aid. For example: "best at text processing", "best for distributed web
>> apps", "fastest for 3d games" etc...
>>
>> One claim that Perl can make is one of the most simple and shortest
>> 'Hello World' programs.
>>
>> There is rumor on the web that there is another language which will
>> execute the code:
>>
>> Hello World
>>
>> and print:
>>
>> Hello World
>>
>> 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
>>
>> Currently, attempting to execute a file or string of code with no
>> content will do absolutely nothing.
>>
>> Of course, with the -W flag, Perl would continue to do nothing, and if
>> one were to use strict, it would no longer be an empty file and
>> therefore would properly execute by strictly doing absolutely nothing.
>>
>> The controversy in this proposal may be the way in which to state:
>>
>> Hello World
>>
>> Here are a few alternatives that have been used traditionally:
>>
>> Hello, World
>> Hello, World!
>> Hello world.
>> hello world...
>>
>> And with the current aggressiveness of Nasa in exploring new worlds,
>> one might consider changing it to:
>>
>> Hello Worlds!
>>

>
> lol (this IS a joke, right?)
>
> Ken
>


Lol, I can't tell if it is or not, but it would be quit funny
Lenny


 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      01-18-2005
"Leonard Challis" <> wrote in news:csk2ht$udm$1
@newsg2.svr.pol.co.uk:

> "Ken" <x3v0-> wrote in message
> news:gXeHd.59$...
>> Larry wrote:


....

>>> One claim that Perl can make is one of the most simple and shortest
>>> 'Hello World' programs.

....

>>>

>>
>> lol (this IS a joke, right?)


> Lol, I can't tell if it is or not, but it would be quit funny


Please stop feeding the troll.

Sinan.
 
Reply With Quote
 
Wes Groleau
Guest
Posts: n/a
 
      01-19-2005
Leonard Challis wrote:
> Lol, I can't tell if it is or not, but it would be quit funny


As in funny enough to make me quit.


--
Wes Groleau
http://groleau.freeshell.org/teaching/
 
Reply With Quote
 
Alfred Z. Newmane
Guest
Posts: n/a
 
      01-19-2005
A. Sinan Unur wrote:
> "Leonard Challis" <> wrote in news:csk2ht$udm$1
> @newsg2.svr.pol.co.uk:
>
>> "Ken" <x3v0-> wrote in message
>> news:gXeHd.59$...
>>> Larry wrote:

>
> ...
>
>>>> One claim that Perl can make is one of the most simple and shortest
>>>> 'Hello World' programs.

> ...
>
>>>>
>>>
>>> lol (this IS a joke, right?)

>
>> Lol, I can't tell if it is or not, but it would be quit funny

>
> Please stop feeding the troll.
>
> Sinan.


Why is he (the OP I assume you were referring to) automatically a troll?
Seemed like a totally harmless "ha ha" orientated question. (If the
person has otherwise truely proved to be a "troll", then I apologize in
advance.)

And if you really think about it, printing /something/ for a completely
empty program (0 bytes), such as version info, rather then a variant of
"hello world", could be useful.

Or how about this, when configuration Perl for the first time, have a
question/option to change the default behavior for 0 byte programs
(default being the do nothing) with the printing of some useful
information, like version, or a 3rd option to print "hello World"
instead. That way everyone can be happy.

Could be useful.


 
Reply With Quote
 
chris-usenet@roaima.co.uk
Guest
Posts: n/a
 
      01-19-2005
Larry <> wrote:
> The controversy in this proposal may be the way in which to state:
> Hello World


> Here are a few alternatives that have been used traditionally:
> Hello, World
> Hello, World!
> Hello world.
> hello world...
> Hello Worlds!


You've missed out the canonical grandfather of them all (Kernigan and
Ritchie, "The C Programming language"):

ObPerl
print "hello, world\n"

Chris
 
Reply With Quote
 
Leonard Challis
Guest
Posts: n/a
 
      01-19-2005
"A. Sinan Unur" <> wrote in message
news:Xns95E2B2F0BEBADasu1cornelledu@132.236.56.8.. .
> "Leonard Challis" <> wrote in news:csk2ht$udm$1
> @newsg2.svr.pol.co.uk:
>
>> "Ken" <x3v0-> wrote in message
>> news:gXeHd.59$...
>>> Larry wrote:

>
> ...
>
>>>> One claim that Perl can make is one of the most simple and shortest
>>>> 'Hello World' programs.

> ...
>
>>>>
>>>
>>> lol (this IS a joke, right?)

>
>> Lol, I can't tell if it is or not, but it would be quit funny

>
> Please stop feeding the troll.
>
> Sinan.


That exactly what I mean about people getting flamed for no reason.
Seems to me some people have real social problems. It's a shame.

Lenny


 
Reply With Quote
 
Michele Dondi
Guest
Posts: n/a
 
      01-19-2005
On 18 Jan 2005 10:22:22 -0800, "Larry" <> wrote:

>Having a superlative description of a language is a great promotional
>aid. For example: "best at text processing", "best for distributed web
>apps", "fastest for 3d games" etc...


Do we need more script kiddies, by any chance?

>One claim that Perl can make is one of the most simple and shortest
>'Hello World' programs.


I wouldn't think this as of being one of its strongest point nor one
of the reasons I love it so much, but...

>There is rumor on the web that there is another language which will
>execute the code:
>
>Hello World
>
>and print:
>
>Hello World


Good for them!

FWIW I would fear such a "feature".

>My proposal for Perl6 is to make Perl execute a sequence of code which


Please note that you should make your proposals for Perl6 in p6l.

I think you'll find, as I did myself, that people here is more
concerned, and by large, with how to do stuff in perl, rather than in
discussions about proposals about Perl{5,6}. (Even if I personally
whish there were more activity/responsiveness in this sense, but it
doesn't count.)

As a side note indeed large parts of Perl6's syntax and semantics are
still being actively redefined, rethought, etc. _but_ I doubt
(s/doubt/am sure/) that a similar proposal could ever be accepted, let
alone the motivations you gave for it...

>is 0 bytes in length with the action of printing to STDOUT:


_What_ is "0 bytes in length"? I can't see anything in your example!!

>Currently, attempting to execute a file or string of code with no
>content will do absolutely nothing.


HUH?!? What is "string of code with no content". Note that the empty
program _is_ a valid program, and it's also the simples trie, in that
it _does_ print itself, i.e. nothing.

>Of course, with the -W flag, Perl would continue to do nothing, and if


It's a particular idea of yours that "perl does nothing" when you give
it a script containing e.g. "hello world\n" and nothing else: it does
a whole lot of things, and it emits an error.

>one were to use strict, it would no longer be an empty file and
>therefore would properly execute by strictly doing absolutely nothing.


Another thing that you'll find out it that in Perl6 strict and
warnings will be turned on _by default_ in most cases, with the most
notable exception being given by one-liners specified by means of -e.

>The controversy in this proposal may be the way in which to state:
>
>Hello World
>
>Here are a few alternatives that have been used traditionally:
>
>Hello, World
>Hello, World!
>Hello world.
>hello world...


WHich drug are you taking? Can I have some?!?

>And with the current aggressiveness of Nasa in exploring new worlds,
>one might consider changing it to:
>
>Hello Worlds!


Wow, I didn't expect you to have such a brilliant sense of humor...


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 
Reply With Quote
 
Michele Dondi
Guest
Posts: n/a
 
      01-19-2005
On Tue, 18 Jan 2005 16:10:35 -0500, Ken <x3v0-> wrote:

>Larry wrote:

[snip 45 more lines]

>lol (this IS a joke, right?)


I don't think so, but I'm not really sure the OP is a troll either.
But then why quoting his whole message (which is alread a waste of
electrons in the first place)? Well, I see, your cmt applies to all of
it, so in some sense it does make sense, but... oh, well: you have
trimmed it down. All in all you're right: if it were a joke, then it
would have been funny after all!


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Weekend project - Directory simplifier - Shortest paths.. rh0dium Python 1 06-09-2006 10:39 PM
Shortest possible valid HTML document? Stewart Gordon HTML 10 06-02-2006 10:51 AM
Shortest prime number program swisscheese Python 19 02-13-2006 05:49 PM
Recursive algoritme for finding the shortest path Webdad C++ 20 12-09-2004 06:51 PM
Shortest path algorithm (other than Dijkstra) ThanhVu Nguyen C++ 6 08-24-2004 12:50 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57