April 1, 2005

Nessie - The Loch Ness Monster in Programming

Martin Bähr writes "The Loch Ness Monster is real: A new programming language has been sighted, it goes by the affectionate name
"nessie" and it claims to be the Loch Ness Monster of programming languages.

the main trait of nessie it borrows from python: indenting.
the main difference to python: it is typed, something that python developers
are now considering for python 3.

ever since i started using python myself i have to agree, indenting is one of
the best ideas in the evolution of the syntax of programming languages that has
been made in a long time. indenting is a must for readable code anyways and
anyone who thinks that indenting is a problem is either writing sloppy code or
has simply never tried python.

i like concise and explicit syntax without redundancy. and that's something
that nessie promises to offer. the syntax should serve both the user and the
compiler. the compiler should not try to guess what the user wants to do, but
it should also not force the user to be overly verbose.

nessie offers a number of interesting things that python does not (yet) have.
one of them is static typing. this topic has always raised a controversy in the
python community. nessie may be the way out for those that do like static
typing without forcing their opinion onto the rest of the python community.

there is also the very compact use of operators on all kinds of data
operations, like splitting a string: instead of s.split(" ") nessie uses s/" "
you divide the string at the spaces. the reverse of course also works:
arr*" " joins an array to a string.

there are many more operators and they can all be applied to almost any type.

there is a well evolved runtime library that offers an astonishing set of
features from image manipulation, a calendar module that supports any kind of
date manipulation you have ever dreamed of, support for most internet
protocols, xml, database access, you name it, it's there.

like python nessie is object oriented, but it offers class member protection
that allows to add security features to your application that are simply not
possible in python.

one interesting feature here is nessies class syntax. you don't need to mark a
class with a keyword, but just but the contents of your class into a file. the
filename becomes the class name. instantiate or inherit the file elsewhere and
you are done.

a bit more about types:
nessie is statically typed but it does not make you go out of your way to make
things work like java does. there is a mixed type which will hold anything, and
brings you back to the same dynamic typing flexibility that python offers.
you may also combine any types as you like: string|int|float.
incidentially a similar syntax for types is being discussed for python.

container types may be specified generic: array (which is really
array(mixed)) or more detailed:

mapping(string:array(array(int(0..359))). the latter is a dictionary
with keys of type string and 2-dimensional arrays with integers ranged from 0
to 359 as values. as you can see the typing is very flexible, you may be as
specific as you want and as generic as you need.

let's have a look at nessie itself:

nessie:
void main()
write("hello world!\n")

pike:
void main()
{
write("hello world!\n");
}

python:
print "hello world!"

nessie is more explicit than python but less redundant than pike.

apart from the indenting syntax, nessie is essentially a dialect of pike.
it uses the pike runtime which brings with it a great amount of features that
have been evolving since the late 80ties. the features described above are
really all just inherited from pike. nessie actually just adds the indenting.
a minor difference, that may have a large impact on those that don't like
braces.

python and pike are both great languages, and so is nessie.
it's time for some change.

Nessie: http://steam.iaeste.at/nessie/
Pike: http://pike.ida.liu.se/"

Link: steam.iaeste.at

Click Here!