Lets post as many different variations of the 'hello world' program in as many different coding languages as we can. Just to give that little used 'code' button some exercise
I'll go first: C++ (of course!)
code:
#include <iostream.h>
int main() { cout << "Hello world!\n"; return 0; }
Posted by Clincher (Member # 7395) on :
VB.NET
Console App
code:
Module Module1
Sub Main() Console.WriteLine("Hello World!") End Sub
End Module
Windows App
code:
Public Class Form1 Inherits System.Windows.Forms.Form
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MessageBox.Show("Hello World!") End Sub End Class
[ May 05, 2005, 02:24 AM: Message edited by: Clincher ]
Posted by Fitz (Member # 4803) on :
LISP. I miss this language...
Posted by Dagonee (Member # 5818) on :
Visual Basic For Applications (Word)
code:
Sub HelloWorld() Dim doc As Word.Document Set doc = Application.Documents.Add() doc.Range().InsertAfter "Hello World" End Sub
Edit: Even shorter version:
code:
Sub HelloWorld() Application.Documents.Add().Range().InsertAfter "Hello World" End Sub
[ May 05, 2005, 09:08 AM: Message edited by: Dagonee ]
Posted by narrativium (Member # 3230) on :
TI-86:
code:
:Disp "Hello world!"
Posted by Swampjedi (Member # 7374) on :
PHP, of course -
code:
<?php
echo 'Hello World!';
?>
Prolog -
code:
hello(D) :- write('hello world'), New is D -1, hello(New).
hello(0).
Posted by Xavier (Member # 405) on :
You know I listed LISP on my resume?
One of the engineers said I "had balls" to list that . I got the job, so yay for LISP.
Posted by Swampjedi (Member # 7374) on :
PL/SQL -
code:
DECLARE msg varchar(50); BEGIN Select text into msg from hello_tbl where world = 1; END; PRINT :msg; . run;
Posted by Tatiana (Member # 6776) on :
Can any other languages do infinite precision integer arithmetic? That's what's so cool about Lisp. It's great for doing number theory stuff, finding prime numbers and printing out every digit of 10,000 factorial or the first million digits of pi or things like that.
I'm about 10 years out of date in programming skillz, though, so likely there's something else way better now. But I just don't know what.
I bet I'm the only one here who's written code in IBM 370 JCL, or DEC PDP-11 machine language. Or how about PL/1? <laughs> A dubious distinction, at best.
My aunt helped write one of the first assemblers at Rand Corporation in the 50s before there were computer science majors (she majored in Math).
When I started my first programming job in 1982 I worked with a guy who had started out soldering boards in order to write his programs. They actually did that at one point, used a solder gun and little wires to write their code, then plugged the board into the slot to run the program. <boggles>
Posted by Hobbes (Member # 433) on :
Wow, ak, that's super-cool!
Posted by Hobbes (Member # 433) on :
Ohh. Adam already did Perl, I didn't see that. Well ... mines longer.
Hobbes
Posted by Hobbes (Member # 433) on :
And on that note, I'm doing my own C++ one.
code:
#include <iostream.h>
int main (int argc, char **argv) { cout << "Hello World" << endl; return 0; }
Hobbes
Posted by Hobbes (Member # 433) on :
code:
#include <iostream.h> #include "HatrackClasses.h"
int main (int argc, char **argv) { Hatracker aka ("aka"); Hatracker Tatiana ("Tatiana"); if (aka == Tatiana) { cout << "They're the same" << endl; } else { cout << "They're not the same" << endl; }
return 0; } /* ------ Output: They're the same */
Hobbes
Posted by Jay (Member # 5786) on :
with Ada.Text_IO;
procedure Hello is begin Ada.Text_IO.Put_Line("Hello, world!"); end Hello;
Ahhh... Ada. Barf. It's what we used in my into CS class. Good ol Dr. Atkins. I guess WVU had some kind of deal with the military to teach ada. Dr. Atkins was a great teacher. Hard as heck tests. But after his class every other CS class was a review.
Posted by Hobbes (Member # 433) on :
code:
#include <iostream.h> #include "HatrackClasses.h" int main (int argc, char **argv) { Hatracker adam613 ("adam613") cout << adam613.getProperties () << endl; return 0; } /* ------ Output: Do-do head */
Hobbes
Posted by The Pixiest (Member # 1863) on :
SOL
: Main "Hello world" write ;
Posted by Dan_raven (Member # 3383) on :
Remind me to nominate this as the "Geekiest Thread Of The Year"
Posted by fugu13 (Member # 2859) on :
Many modern languages allow arbitrary precision arithmetic. Python, Ruby, Perl, all do it effortlessly (actually, never tried in Perl, but I'm pretty sure it can). Java can do it without much trouble.
Posted by Portabello (Member # 7710) on :
The ever-simple python:
code:
print "howdy, y'all!"
Posted by Jutsa Notha Name (Member # 4485) on :
Applescript:
code:
on run display dialog ("Hello, World!" as text) buttons {"OK"} end run
title Hello World Program (helloworld.asm) dosseg .model small .stack 100h .data hello_message db 'Hello, World!',0dh,0ah,'$' .code main proc mov ax,@data mov ds,ax mov ah,9 mov dx,offset hello_message int 21h mov ax,4C00h int 21h main endp end main
Posted by Gregg (Member # 6752) on :
The C++ ones are just a tad C dependent. Here is another variation:
[ May 05, 2005, 12:07 PM: Message edited by: Gregg ]
Posted by fugu13 (Member # 2859) on :
Well, yes, pretty much any computer language we're discussing is Turing complete, and can thus calculate in arbitrary precision arithmetic in some way/shape/form. The ones I listed make it easy, though .
Posted by dabbler (Member # 6443) on :
Shell Script:
code:
#!/bin/sh
echo "Hello, World"
Posted by solo (Member # 3148) on :
AML (Arc Macro Language)
code:
&type Hello World!
Posted by twinky (Member # 693) on :
Is that Brainf(@#%$ or whatever it's called?
Posted by DavidR (Member # 7473) on :
Mathematica:
code:
Mathematica 5.1 for Linux Copyright 1988-2004 Wolfram Research, Inc. -- Motif graphics initialized --
In[1]:= hw = "Hello, World!";
In[2]:= hw
Out[2]= Hello, World!
In[3]:= Quit
PASCAL:
code:
program helloworld
begin writeln('Hello, World!') end
FORTRAN:
code:
program helloworld print*, "Hello World!" end program helloworld