Hello, World…

Bray thinks that the first program which should be documented in any programming language book is “Hello, world.” – and I agree with him.

I have several times felt a pang of “when I am going to be able to interact between the code I am writing and the person who is using that code?” when diving into some new programming language.

The Wikipedia article actually mentions Bray’s issue, without offering a stance:

There are variations in spirit, as well. Functional programming languages, like Lisp, ML, and Haskell, tend to substitute a factorial program for Hello World, as the former emphasizes recursive techniques, which are a big part of functional programming, while the latter emphasizes I/O, which violates the spirit of pure functional programming by producing side effects.

…and yep, I’m with you right there, I sympathise but for one little issue: if a computer solves a (factorial) problem, how shall we ever know until it also shares the result with us?

Comments

3 responses to “Hello, World…”

  1. Carolyn

    Sorry, Alec. The link you refer to in your comment above is broken (but your legs are not!)

  2. Of course, as I was informed by the function languages lecturer at UCL during my MSc, the only really perfect functional language/and/or program would be one which had no input and no output at all and ran on hardware which was mathematically provable.

    The trouble here is that no hardware is mathematically provable as physics has a way of messing things up, especially at the quantum level. Also, any perfect functional program would also be pointless as it would never give any result (as even returning the result would be I/O).

    I seem to remember that this lecturer’s research project was to produce a multi-node parallel functional programming cluster using Motorola 680×0 based boards. The system, of course, had no I/O other than that needed to communicate between the nodes and to load the programs into memory. I don’t think it got very far, probably ‘cos the M68k processors etc. weren’t mathematically provable… also once you get beyond two nodes the whole system would become chaotic (in both a mathematical and physical sense) anyway.

Leave a Reply

Your email address will not be published. Required fields are marked *