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

Carl Banks pavlovevidence at gmail.com
Sun May 10 18:18:37 EDT 2009

On May 10, 12:40 pm, namekuseijin <namekuseijin.nos... at gmail.com>
> Carl Banks wrote:
> > Now, maybe readability concerns don't matter to you personally, but it
> > does matter to the OP, who is trying to advocate functional
> > programming but is having difficulty because most purely functional
> > languages have hideous minimalist syntax that turns people off.
> BTW, rereading it again, the OP was originally questioning about
> compiler optimizations for purely functional constructs within Python,
> but somehow syntax got in the middle.

Syntax--the thing you claim doesn't matter--got in the middle because
it was the main factor that drove the OP to look for alternatives to

That's what makes your entire argument ridiculous; you are making this
theoretical argument like, "everything reduces to a function so it
doesn't matter what syntax you use," yet people in the real world are
out there trying to find alternatives because functional languages'
syntax sucks so bad in general.

> I don't see how "syntax would be a lot easier to understand" if it would
> "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."
> Syntax would remain the same, I guess.

You totally missed the point.

The thing that would make the syntax a lot easier to understand is
that it's in Python and not Haskell.

The reason the OP was asking about separating pure code from impure
was to see if some subset of Python could be used as a pure functional
language, that way they could employ Python and its already-much-
better-than-Haskell's syntax as a pedagogical replacement for Haskell.

I am sure there are many people who think that even "f a b" is cryptic
compared to "f(a,b)", but if that's the only issue it wouldn't be that
big of a deal.  It's not the only issue.  When a language requires you
to read and write stuff like "map :: (x -> y) -> f x -> f y" or "f s@
(x:xs) = x:s" then it's going to turn a lot of people off.

Carl Banks

More information about the Python-list mailing list