r/programming • u/Fragsworth • Jan 01 '09
Why is Haskell so popular on reddit? What does it offer, for instance, that Python doesn't?
98
Upvotes
r/programming • u/Fragsworth • Jan 01 '09
25
u/reddit_clone Jan 01 '09
One Word: dons :-)
29
u/SuperGrade Jan 01 '09
To answer your first question, there are very vocal (and informative/non-annoying) advocates of Haskell posting to reddit - I don't think the number of haskell users is particularly high in itself.
75
u/OceanSpray Jan 01 '09 edited Jan 01 '09
12
u/chromakode Jan 01 '09 edited Jan 01 '09
Don't forget the major speed advantage that comes with a compiled and optimized implementation. Haskell is an elegant and concise language that is fun to program (like Python) that can be used to create extremely fast compiled code.
63
u/Aviator Jan 01 '09 edited Jan 01 '09
If you have been programming in Python long enough, you might notice several shortcomings of Python (or rather any similar imperative programming language in general):
a and b and cnot evaluatebandcuntil each predecessor is checked and proven true, but not the case withall([a, b, c])?def,classandfordo not make use of the assignment operator=. That makes it hard to keep track of assigned variables.lst.sortandsorted(lst)is sort of (no pun intended) awkward and ugly. Why would someone want to sort a list (and modify it) and not return a new one to be combined in a large expression?I was once a Python maniac. But the immense popularity of Haskell in Reddit convinced me to learn it. The thing is really hard to grasp, but after a while, the trade-off is really worth it. Never before I've seen a language so beautiful and so well-made. Coming from a Python background, Haskell convinced me that:
P/S: Sloppy English, I know. To keep my readers entertained, here are some smileys:
[:-1](Python)(:[])(Haskell)9
u/baguasquirrel Jan 01 '09
The other day I was running some feature tests for our code. The tests involved setting up some configurations, after reinstalling the box, setting all the correct networking parameters, etc... takes about half an hour for the run up. The test fails because I left out an apostrophe.
So how about that compile-time checking? What if I want it all? What if I want something as succinct and short as Python, as flexible, and it's still safe? It catches my mistakes for me. The language exists, and it's called Haskell.
25
u/MechaBlue Jan 01 '09
Haskell is a challenge. There are no experts in Haskell, only people who are in different stages of learning.
Haskell is novel. It's purely-functional, non-strict language, and strongly typed, which makes it a large departure from my C++/Java background.
Haskell has less competition. Python is one of several mainstream dynamic, imperative language. I was doing Ruby before it was cool; why should I learn another language to do the same tasks?
43
u/geocar Jan 01 '09 edited Jan 01 '09
Python'rs like python because it matches their mental model of how programming "should be".
Haskell'rs like Haskell because it didn't, and after learning Haskell they discover just how wrong their mental model was.
Some people like to be shown that they are wrong, because it gives them a direction to grow where once they had no direction.
It expands their choices: When they get it, they have a new mental model of programming; they can more easily implement some of the things (features) that make Haskell easy in lesser languages like Python, because those things are now part of their mental model of programming.
That said, Haskell isn't very popular on reddit, it's just that more things are said about it lately so it gets (compared to the number of subscribers) more posts.
24
u/kryptiskt Jan 01 '09
I'd say that Haskell is the most orthogonal usable language around. Its feature set doesn't include things like iteration and variables which are staples in most other programming cultures, and which are available in all other mainstream languages. The reason for this is that Haskell was conceived as a lazy language to replace all other academic lazy languags around in the 80's, and laziness implies purity. Haskell was the only language that tried to tackle making a pure language work in the real world head on, instead of making compromises (which is all too easy if you're working on a strict language).
And now, 20 years later, it turns out purity is jolly convenient when the complexity of software is rising. It automatically isolates large parts of your programs in domains that are typechecked and act predictably only based on the inputs, no internal state. It's a testers dream.
Basically, the reason Haskell is so popular is that it's the only language in a niche which is looking more and more attractive as new ways of handling the increasing complexity of software is needed.
47
u/jsnx Jan 01 '09
Haskell is, at present, the only functional language that...
...all at once. Other functional programming languages get some or the other right; Haskell is presently alone in doing all of them.
5
u/asciilifeform Jan 01 '09
Beauty.
81
u/[deleted] Jan 01 '09
In Python you have to import the "holier.than.thou" package. Haskell gives you the functionality out of box.
18
u/[deleted] Jan 01 '09
Haskell is pure, lazy and statically typed. Python is impure, strict and dynamically typed.
The difference is massive.
31
u/[deleted] Jan 01 '09
It's more obscure than other programming languages, meaning that you'll get more geek cred if you learn it.
1
u/_A_Dumb_Person_ Jul 11 '26
18 years ago damn
8
u/ChrisRathman Jan 01 '09 edited Jan 01 '09
what does Haskell have that Python doesn't: How about syntax for lambda that is not horribly crippled?
10
u/samlee Jan 01 '09
it offers research grant
5
u/[deleted] Jan 01 '09
A consistent syntax.
12
u/blondin Jan 01 '09 edited Jan 01 '09
Who said that? Reddit itself is the offspring of Python.
4
u/Wagnerius Jan 01 '09
performance and a higher level of abstraction. but python has some stuff that haskell doesn't have, due to his very dynamic nature.
In a new, innovative, code-base, I would write performance-critical modules in haskell, and the rest in python.
5
u/13ren Jan 01 '09
A similarity: both seem to have nice communities.
A plus for Haskell: when I search for info on a functional concept of Python, the best hits turn out to be about Haskell. They seem to really have something going there.
5
u/[deleted] Jan 01 '09
Sexiness.
4
u/rixed Jan 01 '09
First, a compiler. The rest is details.
7
u/orthogonality Jan 01 '09
Smug obscurantism. ;)
5
u/mrsanchez Jan 01 '09
I don't understand why. Languages like SML have had pretty much everything Haskell has for decades. Scheme has been around for decades and seems to have everything Python has and a whole lot more. I think a language has to be shitty enough to confuse all the idiots, like how you fool a parakeet by gradually switching it's food from seed to pellets because it would otherwise just stop eating.
4
u/CodeMangler Jan 01 '09 edited Jan 01 '09
4
u/latortuga Jan 01 '09
The ability to write your code without stupid superfluous colons at the end of every line. Zing!
2
u/[deleted] Jan 01 '09 edited Jan 01 '09
It seems to me that Haskell could have been made much easier to learn without any loss of generality by making it less terse, by which I mean the use of more literate programming conventions.
I'm sitting in front of my computer trying to learn Haskell from the "Real World Haskell" book (it's very good, by the way)
I'm on page 30, looking at the definition of a simple function called "myDrop"
I'm being informed that "xs" should be read as "plural of x"
Now, I rewrote this function as follows
It seems to me that the use of words like "aList" instead of xs and functions called "emptyList" instead of "null" as well as extra indentation of THEN and ELSE under IF make it much easier to understand the function (and the syntax) quickly.
One doesn't have to get distracted by thinking about "What is this xs thingy" and "what is null" and so forth.
1
u/KC1956 Jan 31 '09
Haskell offers thinking about a problem/challenge at a higher level of abstraction plus more ruthless efficiency (when using the GHC) than "scripting" languages can offer. Most "scripting" languages cannot offer the efficiency of Haskell except when they are tying together modules written in other languages, like C, C++, Java, FORTRAN and/or are used for calling database engines, which are also written in the above languages.
1
u/penguin673 Jan 02 '09
Perhaps they're the type of programmers Reddit attracts? No offense to either.
And there is a Python subreddit, if you want: http://www.reddit.com/r/Python/
Although that brings up a good point; there is a Haskell subreddit: http://www.reddit.com/r/haskell/
I think programming subreddit needs to be a little more language independent.
-5
u/bitwize Jan 01 '09
ObQwe1234:
0
u/redditacct Jan 02 '09
"What does it offer, for instance, that Python doesn't?"
Visible brackets?
-2
u/apackofwankers Jan 02 '09
Oh ffs, if you want to know the answer to this question - go and read up at haskell.org and python.org - once you have an answer, why not contribute something to the world and publish it.
At this point, "you have such a stunningly superficial view of the world that its almost mbrassing to listen to you".
-14
u/obdurak Jan 01 '09
While it is true that inferred static typing is the one true way to solve our computing pains, I'm sure most Haskellers would, in their hearts, prefer to use a language like Ocaml.
The problem is that Ocaml is (a) too easy to use.
No monadic straightjacket means that it would appeal to conventional programmers and that you can write imperative portions which will work perfectly well with the rest, and you can do Unix programming, etc.
Haskell levels the field between hackers and math nerds who don't know much about computers. It also protects math nerds by having a model different from (some would say "inadapted to") real computers (graph reduction), which utterly confuses real hackers.
(b) Ocaml is developed by Frenchmen, which apparently is double plus ungood. Maybe someone should fork Ocaml and call it Freedom ML or something for you yankees. Or maybe Barack ML.
Just kidding actually. I'm sure Haskell users are progressive people who took refuge in such an intellectually elaborate construction to protect themselves from the waves of anti-intellectualism that have stormed their country for at least 8 years.
-10
u/gordonjay2 Jan 01 '09
it's because Haskell was number 1 on a list of 10 awesome programming languages posted most recently about 2 weeks ago, and this site is full of ADHD-infested crack minds who couldn't make it through the rest of the list.