Gabriel Sechan wrote:
Elegance is in the eye of the beholder.
Exactly.
To me, and many others, its the exact opposite of elegance- it's
difficult to read, difficult to code in. It follows a very
mathematical way of thinking- but most people, including most
programmers, don't normally think in pure mathematics. Imperative
and OO models follow how the majority of programmers think better.
Which is why functional will never be more than a lab project.
That's a little unfair. Most incarnations of Scheme and Lisp are far
from "purely functional". Most have the standard imperative constructs
as well as all the functional ones.
Part of the issue is in how Scheme/Lisp is taught. Professors spend so
much time teaching recursion, closures, continuations, and metacircular
crap that they obscure the usefulness of the language. Things like hash
tables, lists, collections and how to operate on them (map, fold, apply)
are probably brand new to students, too, and are basic concepts that
need to get bashed into their heads because they're useful with other
languages, too. Instead, it all gets buried in the advanced theoretical
stuff.
In addition to imperative constructs, most Schemes have many things
corresponding to object oriented. Quite a few of them actually clone
the CLOS system which certainly qualifies as far more object-oriented
than anything in C++ or Java.
I don't find Scheme to be any harder to read than any other language.
Any system of reasonable size falls under the rubric "hard to read." I
certainly find scheme code much easier to read than C or <gack> C++ of
an equivalent size. Reading code is hard, that's just how it goes.
From my point of view, the big problem with Scheme/Lisp has always been
the community. The community never seems to want to sit down and do the
hard work of playing nicely with the rest of the world (unit tests,
documentation, external FFI's, etc.). PLT Scheme comes closest to
having done the work, but even it wants to "own your world" and that's
just not acceptable. As an example: there are R and Lua bindings for
Gtk and no Scheme bindings. Gee, if I'm looking for an embeddable
language on Unix, am I going to pick Scheme/Lisp which nobody seems to
care enough to write bindings for or am I going to pick Lua which seems
to have a community that doesn't have its head stuck up its posterior.
If I'm already learning a new language, I don't want to be saddled with
learning a new "everything else". I expect to be able to to calls out
to standard libraries in reasonable ways. I expect to be able to use
Gtk without too much grief. If I have to learn the "Lisp GUI" and can't
call a sockets library easily, I'm not going to keep a language long
enough to learn the good stuff. I have to be able to program in my "old
way of thinking" while gradually changing over to thinking in my "new
way of thinking". If you can't do that (and you can't in most
Lisp/Scheme systems), people will give up.
It will be interesting to watch the Scheme/Lisps on the JVM. Most of
the people doing those *get it*. They go out of their way to make sure
that they play nicely with the JVM and that you can access the
underlying Java libraries in some fashion. See Clojure for a nice
example. JScheme seems to get it as well.
The whole "languages on the JVM" does solve the "approved languages
only" problem in corporate environments. This is another one of those
"social" issues that have to be solved for a language to do well. For
example, Perl, for all of its dominance in Unix environments, is still
persona non grata in most Windows environments because it requires
another supported install.
Finally, the "level of abstraction/power" difference between Scheme/Lisp
and the alternatives just isn't as large as it used to be.
"Metaprogramming is crufty in Python" or "Introspection is a pain in
Java" are complaints in a whole different class from "can't add a field
to a structure at runtime in C or C++". Consequently, there just isn't
as much pull to learn Scheme/Lisp. Python, Ruby, Tcl, etc. have "enough
expressiveness" that there's no need to humor a language that demands
that you do things "The One True Way(tm)."
-a
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list