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

  • Thread starter Casey Hawthorne
  • Start date
P

Paul Rubin

Carl Banks said:
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
Haskell.

I don't think so. The OP said that "... the syntax would be a lot
easier to understand, than most functional languages, like Haskell".
He didn't say that Haskell syntax caused him to look for alternatives
and didn't say that Haskell wouldn't still be difficult even if its
syntax were simpler. Hint: Liskell (Haskell with S-expression syntax)
is still difficult.
yet people in the real world are out there trying to find
alternatives because functional languages' syntax sucks so bad in general.

Again, I don't think so. Functional languages' syntax turns some
people off before they even look at other aspects closely, just like
Python's indentation-based syntax turns some people off. But, once
you get past the syntax, functional languages STILL present a lot of
obstacles that lots of users never get past.
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.

That wouldn't make sense at all. 60% of what makes Haskell different
(and harder) than Python is probably the complicated (but powerful)
static type system; 35% is the nonstrict evaluation strategy, and 5%
the syntax. If you somehow added a method in Python to separate pure
from impure code, but it was still a dynamic language with strict
evaluation, you'd only be 5% of the way to replacing Haskell.
 
N

namekuseijin

On May 10, 12:40 pm, namekuseijin <[email protected]>
wrote:
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.

It's not that it sucks. More that it's pretty much non-existent.
Yes, many people are very sensitive to such issue -- that is, that
they feel lost without common constructs permeating the code rather
than the fluid and recursive nature of functional programming and its
never-ending flow of userland function calls.

OTOH, I can't help but think part of it has to do with plain text in
your face rather than lots of colorful keywords in your fav editor.
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.

ah, probably. Python has replaced Scheme in certain pedagogical
circles too. Scheme was considered a great tool for teaching basic
compsci concepts *precisely* for it's lack of syntax so that students
could concentrate on the concepts and problems at hand rather than
fight against the compiler or have to learn a huge tome of libs and
frameworks before even outputting a single "hello world".

But Java was all the rage in the past few years at introductory
compsci and at least no doubt Python is a blessing compared to that.
Though it too is not without a lot of quirks itself...
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"

This is a type annotation and there's nothing similar in Python given
it's typeless nature. Should I call Python's non-existent type
annotations horrible too?
"f s@ (x:xs) = x:s" then it's going to turn a lot of people off.

what about

@foobize
def dingle( n, *boz ): return boz[n:-2]

? Sounds perfectly cryptic for the non-initiated too.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top