[Nomen-dev] Nomen status
Brought to you by:
bhurt
|
From: Brian H. <bh...@sp...> - 2002-11-05 01:18:12
|
In case people on this list haven't noticed it, Nomen, while it isn't
(necessarily) dead, has at least gone into a deep coma.
The reason for this is my lack of time, and my discovery of ocaml.
Bluntly, ocaml already does almost everything I was hoping Nomen would do,
and does it better than Nomen would have. When (and if) Nomen revives, it
will be to improve upon Ocaml (and the other ML derived languages), rather
building ontop of Java.
Which raises a problem: functional programming languages simply aren't
very popular, at least for major development projects. Pop quiz: name a
*fourth* functional language (Lisp is a gimme, and I've mentioned Ocaml
and ML in this message). Now, how many procedural/OO languages can you
name? C, C++, Pascal, Fortran, Java, Perl, Python, Ruby, ...
Functional programming is a major paradigm shift, one in it's own way as
hard to "get" than Object Oriented. And look how long OO took to really
catch on. It's only been the last five years (or less?) that real OO
programming has been going on. Yet Stroustrup started working on what
would become C++ over 21 years ago. Hell, if you count Oak, Java is over
10 years old.
Commercial programmers are incredibly conservative. They have to be- they
don't have time to learn new programming languages just for the hell of
it. The rule in commercial programming is that there isn't time to do it
right, and won't be time to do it over either. Which explains a lot of
commercial software. And there are so many things you *have* to learn,
the API du jour the PHB read about in some magazine, or what changes your
hardware and database vendors add in this release, that learning something
hard just because it might be usefull just isn't in the schedule. And
twenty years later programmers wonder how they became dinosaurs.
And free or open source software engineers are either pros playing at
home, or people wanting to become pros (aka college and highschool
students). Or the increasing number of lucky programmers who have
convinced their boss to opensource all or some of their day job. But in
either case, at least in terms of software engineering open source
software is chasing the tail lights of commercial software development-
right off the cliff, in fact.
The only good thing I can say about the quality of most free or open
source projects is that I can point to commercial code way worse. FOSS
coders have the option of simply abandoning the project if it gets too
bad. Commercial programmers will keep on taking their paychecks all the
way to the bottom of the chasm.
When I started Nomen, my (implicit) assumption was that the tools weren't
there. Ocaml isn't a perfect language (I'm already starting on my list of
things I'd change :-). But it's head and shoulders above anything else
out there. Better, in fundamental respects, than Nomen would have been.
An example. I have oft stated on this list that one of the best things a
library can do is make it easy to write libraries for it. One aspect of
that was allowing generic data structures, but with type checking. Out of
that came the whole 'generic' and 'foo of bar' concepts in Nomen. Ocaml
takes this concepts a quantum leap farther. You don't declare types in
Ocaml (generally), the compiler deduces them. All types are limited to
the extent that the code requires, and no more, and automatically.
Take a simple task: reversing a list. Given a linked list of whatevers,
create a linked list with the same objects but in reverse order. In
Ocaml, this code is:
let rev_list lst =
let rec rev_list_int lst accum =
match lst with
[] -> accum
| head :: tail -> rev_list_int tail (head :: accum)
in
rev_list_int lst []
;;
Understanding the above code, in Ocaml :: is the string concatenation
operation, [] is the empty list, and the match var with case -> expr |
case -> expr ... is a super powerful switch-like creature.
But the important part is that the compiler looks at the above code, and
goes "Hmm. You're using :: and [], which means that lst and accum are
both lists. But you never do anything with what they are lists of. So
they're lists of whatevers." Generic programming is implicit. The above
code works equally well with lists of ints, lists of floats, lists of
lists of btrees of whatevers, etc. All strictly typed.
But this power, this functionality, comes at a cost. And the cost is that
it's hard to wrap your mind around it. You can't cross a chasm in two
jumps. Unfortunately, that's exactly what the development community
demands- two jumps *at least*.
Look at the history- programming started in assembly language. Assembly
became C, which is basically a portable high-level assembly language, with
support for procedural programming (but old style spaghetti code is still
fully supported- you can write an entire program in C using nothing but
gotos). C begat C++, which is C plus object oriented. Of the various
attempts at adding OO to C, C++ won out because it was the only one that
allowed you to continue coding in (well known, well developed) C, and add
in OO as mood and opportunity occurred. Java succeeded due to massive
corporate support (kind of like why Cobol succeeded) as a "simplified
C++".
It's a pest to read, but I'd like to recommend this link:
"Why no one uses functional languages":
http://www.cs.uwa.edu.au/undergraduate/units/230.301/papers/wadler-why.pdf
The reasons, IMHO, boil down to popularity, popularity, popularity,
popularity, packability, popularity, and, well, popularity. Components
don't interface to functional languages because they aren't popular.
Libraries aren't written in functional programming languages because they
aren't popular. Compilers don't exist for every platform under the sun
because they aren't popular. It's hard to find any programmers that know
functional programming languages because they aren't popular. Etc.
In other words, I'm not sure you could do signifigantly better than Java
*and get it accepted by the programming community*. Java was successfull
in large part due to the fact that large companies (Sun, IBM, and Oracle
notably) adopted it and pushed it. The Management by Reading Magazines
crowd all bought into it because the rags pushed it. But even there, push
back happened (how many desktop apps are written in Java?).
Which is why I'm not sure I'll ever revive Nomen. Better languages than
C++ and Java (IMHO) are out there- I just see zero movement to adopt them.
A better solution would be to do a killer app in an already existing
(functional) language, and get it popular.
Brian
|