hello, world

In 1982, I was introduced to my first computer, an Atari 400. A neighbor showed me how to use his Atari 800, including connecting to the Software Exchange BBS using a 300 baud modem. I continued with the Atari 800 XL with an upgraded 128K of RAM. I wrote school papers and a play in Atari Writer, learned my first spreadsheet (SynCalc), and wrote my first programs in Atari Basic learning from Kids & the Atari[CT83], by Edward H. Carlson. The first of 33 lessons is to print hi, an output program typified by Kernighan and Ritchie's beachhead hello, world (see Exercise 1-1 of The C Programming Language[KR78], and Exercise 1-2 of Software Tools in Pascal[KP81] as given by the echo manual, page 45).

The final, main Atari shipped was the 130 XE, to replace the 800 XL, in 1985. I moved on to the IBM Portable PC (the 5155, an XT) with an upgraded PC DOS 3.3 (from its original 2.10). I used WordPerfect 4.2 on that system, but had not found a spreadsheet replacement. I replaced that system with an MS-DOS installation (6.22 in the end). I tried Windows NT on an NEC Ready 9022 Pentium 100 Mhz, which was an improvement to 9.x, dual booting with MS-DOS, but did not take long to switch to Unix.

Though there's history I've had with many other systems and architectures, my current computing habits started with Slackware 2.3. Contrary to popular opinion, though it required a floppy to boot the installer, it did come on a CD-ROM (both from Walnut Creek, and from Volkerding's books). I still have some copies of the first of Volkerding's and Reichard's books. I regret giving some of them away, and discarding some of the old subscription purchased CDs. I also maintain a derivative of Josh Devin's Core Linux on most of my remaining computers, which I've used and upgraded since its release in 2003.

Here are hello, world programs in languages (non-exhaustive) I've learned over the years on many different platforms.

10 REM ATARI BASIC
20 PRINT "HELLO, WORLD"
:10 REM Pittman's Tiny Basic
:20 PRINT "hello, world"
:30 END
:run
hello, world
:
comment Algol-60 Modified Report and ISO 1538: 1984.
begin
  comment The standard does not allow a newline here, (NASE or Marst has \n).
  outstring(1,'hello, world')
end.
       C     Fortran 66
       WRITE (6,7)
     7 FORMAT(13H HELLO, WORLD)
       STOP
       END
program hello
! Fortran 90 and above.
  print *, "hello, world"
end program hello
program hello(output);
  (* Pascal *)
begin writeln('hello, world')
end.
# Unix Bourne, Posix shell, KSH, ZSH
echo hello, world
# Tcl/tclsh
puts "hello, world"
# Perl 5.
print "hello, world";
<?php
// PHP
echo "hello, world\n";
?>
# Python 3.
print("hello, world")

Here's my best guess for Modula(-1). I believe the PDP-11 that Modula was designed on had a teletype for output that would need a string function built, similar to Pascal. The report doesn't specify a built-in, other than a device module that would provide a simple character output write to the teletype, but I could have misread the report. This was too fun to not try assuming a message procedure like in CDC Pascal:

module hello;
  (* Using a Pascal-like message function,
     presumed to be exported from the program module. *)
  use message;
begin message("hello world!")
end hello
MODULE hello;
(* Modula-2 PIM/Medos-2/RT-11 standard library. *)
  FROM InOut IMPORT WriteString, WriteLn;
BEGIN WriteString("hello world!"); WriteLn
END hello.
MODULE hello;
(* Modula-2 ISO/IEC 10514-1:1996 standard library. *)
  FROM STextIO IMPORT WriteString, WriteLn;
BEGIN
  WriteString("hello world!");
  WriteLn
END hello.
(* Oberon 1987/88 definition module. *)
DEFINITION hello;
END hello.

 (* Oberon 1987 implementation module *)
IMPLEMENTATION hello; (* DEE 2018-09-08/2019-07-17 *)
  IMPORT Texts, Oberon;
  VAR W: Texts.Writer;
  
  PROCEDURE world;
  BEGIN Texts.WriteString(W, "hello, world");
    Texts.WriteLn(W);
    Texts.Append(Oberon.Log, W.buf)
  END world;

BEGIN Texts.OpenWriter(W)
END hello.

This relies on the above DEFINITION:

 (* Oberon 1988 module *)
MODULE hello; (*DEE 2019-07-17*)
  IMPORT Texts, Oberon;
  VAR W: Texts.Writer;
  
  PROCEDURE world;
  BEGIN Texts.WriteString(W, "hello, world");
    Texts.WriteLn(W);
    Texts.Append(Oberon.Log, W.buf)
  END world;

BEGIN Texts.OpenWriter(W)
END hello.
(* Using Reiser's In/Out in Oberon since 1989. *)
MODULE hello; IMPORT Out; (* DEE 2018-09-21 *)
BEGIN Out.Open;
  Out.String("hello, world"); Out.Ln
END hello.
(* For Oberon 1989 and Oberon 2013. *)
MODULE hello; (* DEE 2016-08-15 *)
  IMPORT Texts, Oberon;
  VAR W: Texts.Writer;
  
  PROCEDURE world*;
  BEGIN Texts.WriteString(W, "hello, world");
    Texts.WriteLn(W);
    Texts.Append(Oberon.Log, W.buf)
  END world;

BEGIN Texts.OpenWriter(W)
END hello.

References

[CT83]
Edward H. Carlson, Paul D. Trap, Kids and the Atari, Datamost, Inc., Reston Publish Company, Inc. (Prentice-Hall), March 1983
[KP81]
B. W. Kernighan, P. J. Plauger, Software Tools in Pascal, Addison-Wesley, 1981
[KR78]
B. W. Kernighan, D. M. Ritchie, The C Programming Language, Second Edition, Prentice Hall Software Series, 1978, 1988
[GS83]
Hal Glicksman, Kent Simon, Games Ataris Play, Datamost, Inc., Reston Publish Company, Inc. (Prentice-Hall), 1983

©David Egan Evans.