News for hackers. Stuff that matters.
Re:Teenage Haskell by judk on Friday June 27, 2014 @10:01PM (#7957177)
This has been done with Scheme and works really well. But Haskell really is too complex.
Re:Teenage Haskell by codygman on Saturday June 28, 2014 @12:09AM (#7957377)
What about Haskell is too complex?

If you go through A Gentle Introduction to Haskell[0] I think you'll see it's a pretty simple language. There aren't that many parts of core Haskell to learn about.

Perhaps the abstractions such as Monad and Functor are more complex, but they don't seem anymore complex than some of the design patterns used to accomplish what they're used for.

0: http://www.haskell.org/tutorial/

Re:Teenage Haskell by cdsmith on Saturday June 28, 2014 @05:30AM (#7957836)
It's worth mentioning that the tool this blog post is about defines a simplified version of Haskell's standard library. In particular, there are no type classes exported from Prelude, much less monads or functors. In the end, it's not really any more complex than Scheme, except for syntax.

Now, true, the syntax is much more complicated than Scheme. You can operators and precedence and all that. But while definitely complex, it is mostly consistent with math notation. I tried to teach with Scheme first (following www.bootstrapworld.org) before I created this, and I found the change in syntax from what they are used to can be a real obstacle for children. This is also consistent with the comment about MIT moving to Python, which similarly has much more complex but familiar syntax.

Re:Teenage Haskell by gizmo686 on Saturday June 28, 2014 @12:27AM (#7957411)
Monad and Functor are abstract, not complex. One of the things that is easy to forget once you know something is that the complex and concrete thing is often easier to understand than the simple and abstract thing. Of course, eventually you begin to consider the abstract thing to be concrete.
Re:Teenage Haskell by cousin_it on Saturday June 28, 2014 @07:42AM (#7957978)
If you just stick to the idea of type classes, then yeah, it is simple and abstract, even for constructor classes like Functor and Monad. But the reality of type classes in Haskell is not as simple, I think. Defaulting rules, "deriving", Paterson conditions, instance coherence, functional dependencies, etc.
Re:Teenage Haskell by seanmcdirmid on Friday June 27, 2014 @10:35PM (#7957249)
Scheme is quite simple compared to Haskell or even ML. Yet even MIT moved from Scheme to Python.
Re:Teenage Haskell by MichaelGG on Friday June 27, 2014 @10:53PM (#7957287)
Did they have pure intentions in that move? I thought it was more out of popularity than any good metric.
Re:Teenage Haskell by thinkpad20 on Friday June 27, 2014 @11:22PM (#7957332)
The first time I learned programming it was Scheme, and I didn't care for it - the syntax was confusing and it felt more like magical incantations than giving the machine instructions. I didn't touch programming again for several years, but when I did it was python. I found it was much more interesting, in part because of my state of mind but also because I could see the computer responding to what I told it to do and I liked being "in control" of the machine rather than the other way around (which FP can sometimes feel like). I love functional programming now and I write a lot of Haskell, but I think there's real value to starting out with an imperative language to get that "interacting with the machine" feel. It also makes it easier IMO to learn about computational complexity, systems, etc. That, and python has a ton of great libraries, an intuitive syntax, and a lot of flexibility, so I'm not surprised they've adopted it.
Re:Teenage Haskell by seanmcdirmid on Friday June 27, 2014 @11:08PM (#7957312)
Who knows, everyone has their own opinion about it. Perhaps it was just too many parentheses for students to deal with.
Re:Teenage Haskell by judk on Saturday June 28, 2014 @01:51AM (#7957553)
MIT switched to Python because they believe modern basic CS is about controlling complex systems (web APIs, robot APIs) not walking through the history of CS from scratch and bare metal.
Re:Teenage Haskell by fractallyte on Saturday June 28, 2014 @04:43AM (#7957780)
Here are a couple of quotes from 'Realm of Racket', just to expand on your statement:

'All members of this [ALGOL] family are made from more or less the same material and for the same kind of programmers - those who love the machine more than the problem.'

Contrast with Lisp: 'a language that would help programmers solve problems without forcing them to think about the elements of a machine.'

So it really depends on one's interpretation of 'Computer Science', and the choice of what to prioritize from the subject: engineering or ideas.

Re:Teenage Haskell by andreasvc on Saturday June 28, 2014 @05:28AM (#7957826)
That is an incredibly condescending way of arguing. On the other side of the coin you could claim that imperative programming is more practical, concerned with the actual steps needed to solve a problem, instead of an ideal, indirect formulation. Imagine having to explain someone how to bake an apple pie without being able to state any specific steps how to do it but instead describing the pie as some set of interrelationships of the ingredients. (That is probably not a fair characterization of FP, but it's at the same level as "[imperative programmars] love the machine").
Re:Teenage Haskell by fractallyte on Saturday June 28, 2014 @06:30AM (#7957914)
Actually, I would point out that Lisp is not limited to any single paradigm...

But something else you wrote brought to mind this rather interesting statement from - of all places! - the introduction to Michael Barnsley's famous book, 'Fractals Everywhere':

'In deterministic geometry, structures are defined, communicated, and analysed, with the aid of elementary transformations such as affine transformations, scalings, rotations, and congruences. A fractal set generally contains infinitely many points whose organization is so complicated that it is not possible to describe the set by specifying directly where each point in it lies. Instead, the set may be defined by "the relations between the pieces." It is rather like describing the solar system by quoting the law of gravitation and stating the initial conditions. Everything follows from that. It appears always to be better to describe in terms of relationships.'

Re:Teenage Haskell by andreasvc on Saturday June 28, 2014 @11:16AM (#7958385)
I have no idea how your reply relates to my comment. I wouldn't claim that Lisp is limited to a single paradigm, nor do I see how fractals are related to the discussion at hand.
Re:Teenage Haskell by fractallyte on Saturday June 28, 2014 @11:42AM (#7958453)
The point is that Lisp can be imperative too. But, because the language was not constructed according to the underlying physical architecture, it's not bound by the limitations of ALGOL-like languages.

So, rather than condescending, I find this interesting: these are two dissimilar approaches to solving problems.

Your comment about baking an apple pie 'without being able to state any specific steps how to do it but instead describing the pie as some set of interrelationships of the ingredients' was also an excellent statement of the differences between these points of view.

Barnsley's perspective was that relationships may indeed be a better way to describe structures. His concern was fractals, but perhaps the analogy extends to the logical structures that comprise a program.

Re:Teenage Haskell by andreasvc on Saturday June 28, 2014 @05:24PM (#7959394)
What are the "limitations of ALGOL-like languages"? As Turing-complete languages, they probably do not have actual limitations, rather, they suggest a style of programming which may be more or less applicable to particular problems. Functional programming, depending on how pure it is, does have limitations, notably avoiding mutable state.

You can claim that it's interesting that there are these two approaches, but the quotation you gave was definitely condescending, because it flatly states that one approach is better than the other, despite the widespread success of the latter. The argument that it's good to abstract as much as possible from the machine is interesting, but to me it is by no means obvious.

I don't really see the relation with fractals. Although it is an interesting quotation, the relation of fractals to real world phenomena is often very dubious.

Re:Teenage Haskell by marcosdumay on Saturday June 28, 2014 @09:09AM (#7958100)
> without being able to state any specific steps how to do it

All functional languages can express a sequence of steps. More yet, on most of them you can later decide to transform the sequence, instead of just generating code from it.

Re:Teenage Haskell by seanmcdirmid on Saturday June 28, 2014 @10:23AM (#7958266)
As can be done in a procedural language also (and a technique that I use often).
Re:Teenage Haskell by JacksonGariety on Friday June 27, 2014 @11:37PM (#7957347)
SICP is still the bible, even through Python has become the "practical" language that's also quite simplistic.