Introduction to Water Programming

This Site is intended to provide helps to Water language programmers around the world through technical examples, informational articles, and personal assistance.

The following examples are meant to be a quick Getting Started sort of tutorial using the Steam Free Version or the IDE. (If you are using the Free Version, be sure to set the output to "Rendered HTML".)

Example 1. Hello, World!
Since the creators of Water claim it is as easy as Basic, as powerful as Lisp, let's look at the obligatory Hello, World! program in Basic and Lisp first.

Basic:
PRINT "Hello, World!"
Lisp:
"Hello, World!"
Water:
"Hello, World!"

Notice that both Water and Lisp can return "Hello, World!" without the help of a "PRINT" command. However, there is an important distinction here that is easy to miss if you jump to the conclusion that you can just print whatever you want with the same ease. Observe:

Basic:
PRINT "Hello,"
PRINT "World!"
Prints "Hello," on one line, and "World!" on the *next* line.
Lisp:
"Hello,"
"World!"
Prints only "World!" on one line.
Water:
"Hello,"
"World!"
Prints only "World!" on one line, just like Lisp.

To print multiple lines in Lisp and Water, one needs to make sure that the desired output is returned as *one string* of output. For example:

Basic:
PRINT "Hello," + Chr$(13) + Chr$(10) + "World!"
Lisp:
(princ "Hello,\nWorld!")
Water:
"Hello,<BR />World!"

Notice here that Water can still render its output without the help of a print statement. Also, Water can render directly to HTML as its standard output mode, whereas Basic and Lisp were not designed with this in mind.

Go back to go to the next example.

©Copyright 2004, Mr. Merrick J. Stemen. All rights reserved.