I'm intrigued that Python has some functional constructions in the language.

Paul Rubin http
Sat May 9 02:49:51 CEST 2009


Casey Hawthorne <caseyhHAMMER_TIME at istar.ca> writes:
> Would it be possible to more clearly separate the pure code (without
> side effects) from the impure code (that deals with state changes,
> I/O, etc.), so that the pure code could be compiled and have
> aggressive functional transformations applied to it for efficiency.

This doesn't fit Python semantics terribly well.

> That way, the syntax would be a lot easier to understand, than most
> functional languages, like Haskell.

I don't think it would help much, even if it was done (see below).

> I gave a presentation at the beginning of last year on Haskell and at
> the end, someone's comment was, "I can see the benefits of functional
> programming but why does it have to be so cryptic."

Haskell's syntax (like Python's or Lisp's) takes a little getting used
to, but in my experience it's not really cryptic.  IMHO, functional
programming is difficult for imperative programmers to understand at
first, because the concepts in it are really different from what
imperative programmers are generally used to, and that take some head
scratching to make sense of.  Think of a beginning imperative
programmer encountering recursion or coroutines for the first time, or
how someone learning calculus deals with the concepts of limits and
continuity.  These subjects have certain hurdles that require effort
to get past, but which expand the range of problems that someone who
has put in the effort can solve.  Functional programming presents more
such hurdles, and more such expansion.



More information about the Python-list mailing list