[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: s-exprs + prototypes



Felix Klock wrote:
> Reasoning, analysis, optimization, and verification are HUMAN
> activities as well as programmatic ones.

No argument there.

> I personally suspect that functional-programming probably makes
> human-based optimization harder (you can do more tricks with mutable
> state available).

You may be right when it comes to 100% mutation-free programming, as in e.g.
Haskell.  However, I think there may be a sweet spot for languages which
significantly deprecate mutation, but still provide support for it and don't
lose all their good functional properties because of its presence.  The ML
family seems to manage this reasonably well, although with most of the
functional languages there's room for better "human support".

At the moment, imperative programmers use mutation without thinking about
it, and they've mostly never learned any other way to program.  Most use of
mutation is gratuitous, and simply arises from the design of imperative
languages which actively encourage & require it.  I don't think eliminating
these uses of mutation is in any way fundamentally difficult for humans, as
long as languages provide constructs that support basic features like
iteration and recursion in ways that are comfortable to use.

The biggest barrier right now is that most programmers aren't even aware of
the possibility or desirability of avoiding mutation.  It's a bit like where
smoking was in the '70s - give it another 20 or 30 years, and there'll be
signs in classrooms and offices saying "no mutation", but old fogies and
rebellious kids will still be doing it, wherever they can get away with
it...

Anton