Mees de Vries
Mees de Vries

Reputation: 659

Is there a language in which `print, "hello, world!"` is a valid Hello World program?

My Code Jam T-shirt has the following snippet of code on the front.

print, "hello, world!"

Here is an image of it (taken from the Hash Code Twitter, not my T-shirt):

This is not a correct Hello World program in any language that I know. It is almost Python 2, but not quite. Apparently it runs in Javascript, but it doesn't give any output. I have asked several people, and none of them know.

Is there any programming language in which this is a valid Hello, world program?

Upvotes: 0

Views: 353

Answers (2)

Swift - Friday Pie
Swift - Friday Pie

Reputation: 14673

It looks like early algol or similar language, comma after print indicates omitted first parameter (which was device name or punch device id usually). Not all implementations allowed to omit it, but such omission was inherited by 80s-90s interpreter languages.

Algol 60 didn't had standard I/O, but some versions had output in form of PRINT <device>, <some tags>, <data>

Upvotes: 0

This could be Basic, which uses the comma as a "zone" delimiter. So it basically (hah) effects a 15 space indent before "hello world!".

See http://www.dartmouth.edu/basicfifty/commands.html, "PRINT Statements".

Although of course, it could also be something else entirely =D

Upvotes: 1

Related Questions